jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 1 | *** QuickStart *** |
| 2 | |
| 3 | REQUIREMENTS |
| 4 | |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 5 | Linux |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 6 | OpenGGSN was developed and tested using Redhat 7.1 and Redhat |
| 7 | 7.2. It should run also on other Linux distributions as well as |
| 8 | FreeBSD and Solaris, but this is untested. Please tell me of any |
| 9 | testing results. |
| 10 | |
| 11 | Tun |
| 12 | Both ggsn and sgsnemu uses the tun package. You need at least tun |
| 13 | version 1.1. See http://vtun.sourceforge.net/tun/ for instructions on |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 14 | installation. Tun is included in the kernel from early version 2.4, so |
jjako | b306169 | 2003-01-14 17:13:26 +0000 | [diff] [blame] | 15 | you will not normally need to install it. For Redhat 7.1, 7.2 and 8.0 |
| 16 | you do however need to do the following: |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 17 | mkdir /dev/net |
| 18 | mknod /dev/net/tun c 10 200 |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 19 | Add this line to /etc/modules.conf: alias char-major-10-200 tun |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 20 | depmod -a |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 21 | |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 22 | |
| 23 | COMPILATION and INSTALLATION |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 24 | |
jjako | b306169 | 2003-01-14 17:13:26 +0000 | [diff] [blame] | 25 | 1 ./configure |
jjako | 7bac2f8 | 2003-01-29 10:24:10 +0000 | [diff] [blame] | 26 | 2 make |
| 27 | 3 make install |
jjako | b306169 | 2003-01-14 17:13:26 +0000 | [diff] [blame] | 28 | |
| 29 | You need to be root in order to install the package, but not in order |
| 30 | to compile. |
| 31 | |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 32 | RUNNING |
| 33 | |
| 34 | sgsnemu |
| 35 | Edit the configuration file sgsnemu.conf found under |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 36 | openggsn/examples. Use sgsnemu -h for a list of available options. |
jjako | b306169 | 2003-01-14 17:13:26 +0000 | [diff] [blame] | 37 | Start the emulator as root using the command: |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 38 | |
jjako | 7bac2f8 | 2003-01-29 10:24:10 +0000 | [diff] [blame] | 39 | sgsnemu -c examples/sgsnemu.conf -l 10.20.30.50 -r 10.20.30.40 --createif |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 40 | |
| 41 | This will cause the sgsn emulator to bind to local address 10.20.30.50 |
| 42 | and connect to the ggsn found at 10.20.30.40. It will first send off |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 43 | an ECHO_REQUEST message. After this it will attempt to establish a pdp |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 44 | context. If successful it will create a local interface and set up |
| 45 | routing. Now you should be able to ping through the connection. Use a |
| 46 | network analysator such as ethereal to monitor the traffic. |
| 47 | |
| 48 | ggsn |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 49 | Edit the configuration file ggsn.conf found under |
| 50 | openggsn/examples. Use sgsnemu -h for a list of available options. |
jjako | b306169 | 2003-01-14 17:13:26 +0000 | [diff] [blame] | 51 | Start the ggsn as root using the command: |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 52 | |
| 53 | ggsn --fg -c examples/ggsn.conf -l 10.20.30.40 --statedir . |
| 54 | |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 55 | This will run the ggsn in foreground using the local interface |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 56 | 10.20.30.40. Of cause you can use sgsnemu to test the GGSN. |
| 57 | |
| 58 | |
| 59 | SUPPORT |
| 60 | If you have any questions drop me a line at jj@openggsn.org. |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 61 | |
| 62 | |
| 63 | *** Features *** |
| 64 | |
| 65 | OpenGGSN is an open source implementation of GPRS Support Nodes |
| 66 | (GSNs). It implements the GPRS tunneling protocol (GTP) version 0. |
| 67 | |
| 68 | OpenGGSN provides 3 components: |
| 69 | * gtplib |
| 70 | * ggsn |
| 71 | * sgsnemu |
| 72 | |
| 73 | gtplib |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 74 | This library contains all functionality relating to the GTP |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 75 | protocol. Use this libraty if you want to implement your own |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 76 | GSN. Currently gtplib supports GTPv0. At the moment no interface |
| 77 | documentation is available for download. |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 78 | |
| 79 | ggsn |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 80 | The ggsn implements a Gateway GPRS Support Node. The GGSN is a small |
| 81 | application which is provided in order to test and demonstrate the use |
| 82 | of gtplib. It is fully compliant to the 3GPP standards, but lacks |
| 83 | important functionality such as charging and management. Use this |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 84 | application as a starting point if you want to build your own GGSN |
| 85 | with your own fancy VPN, management and charging functionality. |
| 86 | |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 87 | sgsnemu |
| 88 | This application emulates a Serving GPRS Support Node (SGSN). sgsnemu |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 89 | enables you to test your 3GPP core network without the need to invest |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 90 | in a 3G radio access network. An important application of sgsnemu is |
| 91 | the testing of roaming connectivity through a GPRS roaming exchange. |
| 92 | |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 93 | |
jjako | 7bac2f8 | 2003-01-29 10:24:10 +0000 | [diff] [blame] | 94 | *** Performance *** |
| 95 | |
| 96 | Two experiments were performed in order to test the performance of |
| 97 | sgsnemu and ggsn. The ggsn used a 550 MHz Athlon with 384 MB of |
| 98 | RAM. sgsnemu used a 1 GHz Athlon with 256 MB of RAM. Both machines had |
| 99 | 100 Mb/s NICs and were connected through a Netgear FS105 switch. Both |
| 100 | tests were performed by sending ICMP echo packets from the ggsn to |
| 101 | sgsnemu. |
| 102 | |
| 103 | 89.4 Mb/s IP downlink throughput when sending 10001 ICMP ping packets |
| 104 | with a payload of 1000 bytes. Transfer time 0.9 sec, no packets lost. |
| 105 | |
| 106 | 17,1 Mb/s IP downlink throughput when sending 10001 ICMP ping packets with |
| 107 | a payload of 100 bytes. Transfer time 0.6 sec, no packets lost. |
| 108 | |
| 109 | |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 110 | *** Required software *** |
| 111 | |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 112 | TUN (http://vtun.sourceforge.net/tun/) |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 113 | |
| 114 | Both ggsn and sgsnemu uses the tun package. You need at least tun |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 115 | version 1.1. See the above web page for instructions on |
| 116 | installation. Tun is included in the kernel from early version 2.4, so |
jjako | b306169 | 2003-01-14 17:13:26 +0000 | [diff] [blame] | 117 | you will not normally need to install it. For Redhat 7.1, 7.2 and 8.0 |
| 118 | you do however need to do the following: |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 119 | mkdir /dev/net |
| 120 | mknod /dev/net/tun c 10 200 |
| 121 | Add the following line to /etc/modules.conf: alias char-major-10-200 tun |
| 122 | depmod -a |
| 123 | |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 124 | |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 125 | GENGETOPT (http://www.gnu.org/software/gengetopt/gengetopt.html) |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 126 | |
| 127 | Gengetopt is required if you want to change the options defined in the |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 128 | cmdline.ggo source file. You need at least gengetopt version 2.8. If |
| 129 | you are just going to compile the programs you don't need gengetopt. |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 130 | |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 131 | To use gengetopt for the ggsn do the following: |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 132 | cd ggsn |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 133 | gengetopt < cmdline.ggo --conf-parser |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 134 | |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 135 | To use gengetopt for the sgsnemu do the following: |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 136 | cd sgsnemu |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 137 | gengetopt < cmdline.ggo --conf-parser |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 138 | |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 139 | |
| 140 | *** Compilation and Installation *** |
| 141 | |
jjako | b306169 | 2003-01-14 17:13:26 +0000 | [diff] [blame] | 142 | SETTING UP AUTOTOOLS |
| 143 | |
| 144 | You do not need to perform this step if you are only going to compile |
| 145 | the package: |
| 146 | |
jjako | 7bac2f8 | 2003-01-29 10:24:10 +0000 | [diff] [blame] | 147 | 0 Get version from somewhere: Script to extract version from configure.in |
jjako | b306169 | 2003-01-14 17:13:26 +0000 | [diff] [blame] | 148 | 1 Copy the latest config.guess and config.sub from ftp://ftp.gnu.org/gnu/config |
jjako | 7bac2f8 | 2003-01-29 10:24:10 +0000 | [diff] [blame] | 149 | 2 Run autoscan and copy configure.scan to configure.in |
| 150 | 3 Add/edit the following lines in configure.in: |
jjako | b306169 | 2003-01-14 17:13:26 +0000 | [diff] [blame] | 151 | 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() |
| 157 | 4 libtoolize --automake --copy |
| 158 | (ads copy of ltmain.sh) |
| 159 | 5 aclocal |
| 160 | 6 autoheader |
jjako | 7bac2f8 | 2003-01-29 10:24:10 +0000 | [diff] [blame] | 161 | 7 automake --add-missing --copy |
| 162 | (Ads copy of mkinstalldirs missing, install-sh, depcomp) |
jjako | b306169 | 2003-01-14 17:13:26 +0000 | [diff] [blame] | 163 | 8 automake |
| 164 | 9 autoconf |
| 165 | |
| 166 | The above will initialise the project to the current version of |
| 167 | autotools (As installed in RedHat 8.0). See |
| 168 | http://sources.redhat.com/autobook/autobook/autobook_25.html#SEC25 |
| 169 | for details on autotools. |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 170 | |
| 171 | |
jjako | b306169 | 2003-01-14 17:13:26 +0000 | [diff] [blame] | 172 | COMPILATION 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 |
| 184 | 10 run ldconfig |
| 185 | (Step 9 and 10 are not required as path to libgtp is included in Makefile) |
| 186 | |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 187 | |
| 188 | *** Running ggsn *** |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 189 | |
| 190 | Use ggsn -h for a list of available options. All options available on |
| 191 | the command line can also be given in a configuration file. See |
| 192 | examples/ggsn.conf for the format of this file. |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 193 | |
jjako | 7bac2f8 | 2003-01-29 10:24:10 +0000 | [diff] [blame] | 194 | Remember to enable routing: echo 1 > /proc/sys/net/ipv4/ip_forward |
| 195 | |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 196 | *** Running sgsnemu *** |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 197 | |
| 198 | Use sgsnemu -h for a list of available options. All options available |
| 199 | on the command line can also be given in a configuration file. See |
| 200 | examples/sgsnemu.conf for the format of this file. |
| 201 | |
| 202 | If you want to test a GRX roaming connection you will need to do the |
| 203 | following: |
| 204 | |
| 205 | 1) Install sgsnemu on a Linux Box. See under installation above. |
| 206 | |
| 207 | 2) Connect your Linux box with sgsnemu installed to the GPRS core |
| 208 | network. Use the same LAN switch as the one your SGSN is connected |
| 209 | to. You also need a free IP address that can be used by sgsnemu. |
| 210 | |
| 211 | 3) You need to configure networking in terms of interface address, |
| 212 | subnet mask and default route. See the Linux Networking HOWTO for |
| 213 | details. |
| 214 | |
| 215 | 4) 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 | |
| 219 | sgsnemu 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 | |
| 237 | This is quite good. It means that you managed to send off an echo |
| 238 | request to a remote GGSN, and it was friendly enough to answer you. If |
| 239 | you did not get an echo response it means that something is wrong |
| 240 | either with your setup OR with the GRX connection OR with your roaming |
| 241 | partners connection. |
| 242 | |
| 243 | If the above went well you might want to try to establish a PDP |
jjako | 7bac2f8 | 2003-01-29 10:24:10 +0000 | [diff] [blame] | 244 | context to the remote GGSN. Note that you should be careful when |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 245 | establishing PDP contexts using sgsnemu as each established PDP |
| 246 | context will result in a Charge Detail Record (CDR) being generated by |
| 247 | the GGSN. You should use real IMSI and MSISDN from a valid test SIM |
| 248 | card. Otherwise some poor customer might get charged for your |
| 249 | testing. Also note that you are establishing a connection to the Gi |
jjako | 7bac2f8 | 2003-01-29 10:24:10 +0000 | [diff] [blame] | 250 | network, so please be carefull not to route internet traffic onto the |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 251 | GPRS core network! Assuming you know what you are doing: |
| 252 | |
jjako | 7bac2f8 | 2003-01-29 10:24:10 +0000 | [diff] [blame] | 253 | 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 |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 254 | |
| 255 | sgsnemu 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 | |
| 279 | Now a context is established to the remote GGSN. The IP address of the |
| 280 | context is 192.168.0.1. If you specified the correct --net and --mask |
| 281 | you should be able to ping a known address on the Gi network of the |
| 282 | roaming partner. You should even be able to do web browsing through |
| 283 | the PDP context. |
| 284 | |
| 285 | Note however that you probably need to adjust your routing tables, so |
| 286 | that you make sure that all GRX traffic is routed to the GPRS core |
| 287 | network and everything else through the PDP context. The proper way to |
| 288 | do this is to use policy routing. Also note that you are effectively |
| 289 | connecting the same computer to both the Gn and Gi network, so please |
| 290 | be carefull not to route internet traffic onto the GPRS core network |
| 291 | and please protect yourself against hackers! For this reason it is |
| 292 | advised to always use --contexts 0 when testing a live network. |
| 293 | |
| 294 | After --timelimit seconds the PDP context is disconnected with the |
| 295 | following messages from sgsnemu: |
| 296 | |
| 297 | Disconnecting PDP context #0 |
| 298 | Received delete PDP context response. Cause value: 128 |
| 299 | Deleting tun interface |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 300 | |