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 |
| 26 | 2 cd gtp |
| 27 | 3 make |
| 28 | 4 make install |
| 29 | 5 cd .. |
| 30 | 6 make |
| 31 | 7 make install |
| 32 | 8 Add /usr/local/lib to /etc/ld.so.conf |
| 33 | 9 Run ldconfig |
| 34 | |
| 35 | You need to be root in order to install the package, but not in order |
| 36 | to compile. |
| 37 | |
| 38 | Steps 2 to 5 are only needed the first time you install the |
| 39 | package. Most likely steps 8 and 9 can be omitted as the path to |
| 40 | libgtp is now included in Makefile.am for sgsnemu and ggsn. |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 41 | |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 42 | RUNNING |
| 43 | |
| 44 | sgsnemu |
| 45 | Edit the configuration file sgsnemu.conf found under |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 46 | openggsn/examples. Use sgsnemu -h for a list of available options. |
jjako | b306169 | 2003-01-14 17:13:26 +0000 | [diff] [blame] | 47 | Start the emulator as root using the command: |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 48 | |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 49 | sgsnemu -c examples/sgsnemu.conf -l 10.20.30.50 -r 10.20.30.40 |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 50 | |
| 51 | This will cause the sgsn emulator to bind to local address 10.20.30.50 |
| 52 | 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] | 53 | an ECHO_REQUEST message. After this it will attempt to establish a pdp |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 54 | context. If successful it will create a local interface and set up |
| 55 | routing. Now you should be able to ping through the connection. Use a |
| 56 | network analysator such as ethereal to monitor the traffic. |
| 57 | |
| 58 | ggsn |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 59 | Edit the configuration file ggsn.conf found under |
| 60 | openggsn/examples. Use sgsnemu -h for a list of available options. |
jjako | b306169 | 2003-01-14 17:13:26 +0000 | [diff] [blame] | 61 | Start the ggsn as root using the command: |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 62 | |
| 63 | ggsn --fg -c examples/ggsn.conf -l 10.20.30.40 --statedir . |
| 64 | |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 65 | This will run the ggsn in foreground using the local interface |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 66 | 10.20.30.40. Of cause you can use sgsnemu to test the GGSN. |
| 67 | |
| 68 | |
| 69 | SUPPORT |
| 70 | If you have any questions drop me a line at jj@openggsn.org. |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 71 | |
| 72 | |
| 73 | *** Features *** |
| 74 | |
| 75 | OpenGGSN is an open source implementation of GPRS Support Nodes |
| 76 | (GSNs). It implements the GPRS tunneling protocol (GTP) version 0. |
| 77 | |
| 78 | OpenGGSN provides 3 components: |
| 79 | * gtplib |
| 80 | * ggsn |
| 81 | * sgsnemu |
| 82 | |
| 83 | gtplib |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 84 | This library contains all functionality relating to the GTP |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 85 | protocol. Use this libraty if you want to implement your own |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 86 | GSN. Currently gtplib supports GTPv0. At the moment no interface |
| 87 | documentation is available for download. |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 88 | |
| 89 | ggsn |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 90 | The ggsn implements a Gateway GPRS Support Node. The GGSN is a small |
| 91 | application which is provided in order to test and demonstrate the use |
| 92 | of gtplib. It is fully compliant to the 3GPP standards, but lacks |
| 93 | important functionality such as charging and management. Use this |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 94 | application as a starting point if you want to build your own GGSN |
| 95 | with your own fancy VPN, management and charging functionality. |
| 96 | |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 97 | sgsnemu |
| 98 | This application emulates a Serving GPRS Support Node (SGSN). sgsnemu |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 99 | enables you to test your 3GPP core network without the need to invest |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 100 | in a 3G radio access network. An important application of sgsnemu is |
| 101 | the testing of roaming connectivity through a GPRS roaming exchange. |
| 102 | |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 103 | |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 104 | *** Required software *** |
| 105 | |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 106 | TUN (http://vtun.sourceforge.net/tun/) |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 107 | |
| 108 | Both ggsn and sgsnemu uses the tun package. You need at least tun |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 109 | version 1.1. See the above web page for instructions on |
| 110 | installation. Tun is included in the kernel from early version 2.4, so |
jjako | b306169 | 2003-01-14 17:13:26 +0000 | [diff] [blame] | 111 | you will not normally need to install it. For Redhat 7.1, 7.2 and 8.0 |
| 112 | you do however need to do the following: |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 113 | mkdir /dev/net |
| 114 | mknod /dev/net/tun c 10 200 |
| 115 | Add the following line to /etc/modules.conf: alias char-major-10-200 tun |
| 116 | depmod -a |
| 117 | |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 118 | |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 119 | GENGETOPT (http://www.gnu.org/software/gengetopt/gengetopt.html) |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 120 | |
| 121 | Gengetopt is required if you want to change the options defined in the |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 122 | cmdline.ggo source file. You need at least gengetopt version 2.8. If |
| 123 | you are just going to compile the programs you don't need gengetopt. |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 124 | |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 125 | To use gengetopt for the ggsn do the following: |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 126 | cd ggsn |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 127 | gengetopt < cmdline.ggo --conf-parser |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 128 | |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 129 | To use gengetopt for the sgsnemu do the following: |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 130 | cd sgsnemu |
jjako | 0ac82a1 | 2003-01-05 18:36:33 +0000 | [diff] [blame] | 131 | gengetopt < cmdline.ggo --conf-parser |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 132 | |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 133 | |
| 134 | *** Compilation and Installation *** |
| 135 | |
jjako | b306169 | 2003-01-14 17:13:26 +0000 | [diff] [blame] | 136 | SETTING UP AUTOTOOLS |
| 137 | |
| 138 | You do not need to perform this step if you are only going to compile |
| 139 | the package: |
| 140 | |
| 141 | 0 Get version from somewhere: Script to extract version from configure.ac |
| 142 | 1 Copy the latest config.guess and config.sub from ftp://ftp.gnu.org/gnu/config |
| 143 | 2 Run autoscan and copy configure.scan to configure.ac |
| 144 | 3 Add/edit the following lines in configure.ac: |
| 145 | AC_INIT(openggsn, 0.52, jj@openggsn.org) |
| 146 | AC_CONFIG_SRCDIR([gtp/gtp.c]) |
| 147 | AM_CONFIG_HEADER([config.h]) |
| 148 | AC_PROG_LIBTOOL |
| 149 | AM_PROG_LIBTOOL |
| 150 | AM_INIT_AUTOMAKE() |
| 151 | 4 libtoolize --automake --copy |
| 152 | (ads copy of ltmain.sh) |
| 153 | 5 aclocal |
| 154 | 6 autoheader |
| 155 | 7 automake --add-missing |
| 156 | (Ads link to missing, install-sh, depcomp) |
| 157 | 8 automake |
| 158 | 9 autoconf |
| 159 | |
| 160 | The above will initialise the project to the current version of |
| 161 | autotools (As installed in RedHat 8.0). See |
| 162 | http://sources.redhat.com/autobook/autobook/autobook_25.html#SEC25 |
| 163 | for details on autotools. |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 164 | |
| 165 | |
jjako | b306169 | 2003-01-14 17:13:26 +0000 | [diff] [blame] | 166 | COMPILATION AND INSTALLATION |
| 167 | |
| 168 | 1 ./configure |
| 169 | 2 make clean |
| 170 | 3 cd gtp |
| 171 | 4 make |
| 172 | 5 make install (as root) |
| 173 | 6 cd .. |
| 174 | (Step 3 to 6 you only need to run the first time to install libgtp) |
| 175 | 7 make |
| 176 | 8 make install (as root) |
| 177 | 9 Add /usr/local/lib to /etc/ld.so.conf |
| 178 | 10 run ldconfig |
| 179 | (Step 9 and 10 are not required as path to libgtp is included in Makefile) |
| 180 | |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 181 | |
| 182 | *** Running ggsn *** |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 183 | |
| 184 | Use ggsn -h for a list of available options. All options available on |
| 185 | the command line can also be given in a configuration file. See |
| 186 | examples/ggsn.conf for the format of this file. |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 187 | |
| 188 | *** Running sgsnemu *** |
jjako | bcbfb41 | 2003-01-06 21:21:03 +0000 | [diff] [blame] | 189 | |
| 190 | Use sgsnemu -h for a list of available options. All options available |
| 191 | on the command line can also be given in a configuration file. See |
| 192 | examples/sgsnemu.conf for the format of this file. |
| 193 | |
| 194 | If you want to test a GRX roaming connection you will need to do the |
| 195 | following: |
| 196 | |
| 197 | 1) Install sgsnemu on a Linux Box. See under installation above. |
| 198 | |
| 199 | 2) Connect your Linux box with sgsnemu installed to the GPRS core |
| 200 | network. Use the same LAN switch as the one your SGSN is connected |
| 201 | to. You also need a free IP address that can be used by sgsnemu. |
| 202 | |
| 203 | 3) You need to configure networking in terms of interface address, |
| 204 | subnet mask and default route. See the Linux Networking HOWTO for |
| 205 | details. |
| 206 | |
| 207 | 4) Launch sgsnemu with something like: |
| 208 | |
| 209 | sgsnemu --fg --listen 10.20.30.50 --remote 10.20.30.40 --dns 10.20.38.51 --timelimit 10 --contexts 0 |
| 210 | |
| 211 | sgsnemu will print something like the following on the screen: |
| 212 | |
| 213 | Using DNS server: 10.20.38.51 (10.20.38.51) |
| 214 | Local IP address is: 10.20.30.50 (10.20.30.50) |
| 215 | Remote IP address is: 10.20.30.40 (10.20.30.40) |
| 216 | IMSI is: 240011234567890 (0x98765432110042) |
| 217 | Using APN: internet |
| 218 | Using MSISDN: 46702123456 |
| 219 | |
| 220 | Initialising GTP library |
| 221 | OpenGGSN[1823]: GTP: gtp_newgsn() started |
| 222 | Done initialising GTP library |
| 223 | |
| 224 | Sending off echo request |
| 225 | Waiting for response from ggsn........ |
| 226 | |
| 227 | Received echo response. Cause value: 0 |
| 228 | |
| 229 | This is quite good. It means that you managed to send off an echo |
| 230 | request to a remote GGSN, and it was friendly enough to answer you. If |
| 231 | you did not get an echo response it means that something is wrong |
| 232 | either with your setup OR with the GRX connection OR with your roaming |
| 233 | partners connection. |
| 234 | |
| 235 | If the above went well you might want to try to establish a PDP |
| 236 | context to the remote GGSN. Note that you should be carefull when |
| 237 | establishing PDP contexts using sgsnemu as each established PDP |
| 238 | context will result in a Charge Detail Record (CDR) being generated by |
| 239 | the GGSN. You should use real IMSI and MSISDN from a valid test SIM |
| 240 | card. Otherwise some poor customer might get charged for your |
| 241 | testing. Also note that you are establishing a connection to the Gi |
| 242 | netowrk, so please be carefull not to route internet traffic onto the |
| 243 | GPRS core network! Assuming you know what you are doing: |
| 244 | |
| 245 | 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 |
| 246 | |
| 247 | sgsnemu will print something like the following on the screen: |
| 248 | |
| 249 | Using DNS server: 10.20.38.51 (10.20.38.51) |
| 250 | Local IP address is: 10.20.30.50 (10.20.30.50) |
| 251 | Remote IP address is: 10.20.30.40 (10.20.30.40) |
| 252 | IMSI is: 240011234567890 (0x98765432110042) |
| 253 | Using APN: internet |
| 254 | Using MSISDN: 46702123456 |
| 255 | |
| 256 | Initialising GTP library |
| 257 | OpenGGSN[1838]: GTP: gtp_newgsn() started |
| 258 | Done initialising GTP library |
| 259 | |
| 260 | Sending off echo request |
| 261 | Setting up PDP context #0 |
| 262 | Waiting for response from ggsn........ |
| 263 | |
| 264 | Received echo response. Cause value: 0 |
| 265 | Received create PDP context response. Cause value: 128 |
| 266 | Setting up interface and routing |
| 267 | /sbin/ifconfig tun0 192.168.0.1 |
| 268 | /sbin/route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.0.1 |
| 269 | |
| 270 | |
| 271 | Now a context is established to the remote GGSN. The IP address of the |
| 272 | context is 192.168.0.1. If you specified the correct --net and --mask |
| 273 | you should be able to ping a known address on the Gi network of the |
| 274 | roaming partner. You should even be able to do web browsing through |
| 275 | the PDP context. |
| 276 | |
| 277 | Note however that you probably need to adjust your routing tables, so |
| 278 | that you make sure that all GRX traffic is routed to the GPRS core |
| 279 | network and everything else through the PDP context. The proper way to |
| 280 | do this is to use policy routing. Also note that you are effectively |
| 281 | connecting the same computer to both the Gn and Gi network, so please |
| 282 | be carefull not to route internet traffic onto the GPRS core network |
| 283 | and please protect yourself against hackers! For this reason it is |
| 284 | advised to always use --contexts 0 when testing a live network. |
| 285 | |
| 286 | After --timelimit seconds the PDP context is disconnected with the |
| 287 | following messages from sgsnemu: |
| 288 | |
| 289 | Disconnecting PDP context #0 |
| 290 | Received delete PDP context response. Cause value: 128 |
| 291 | Deleting tun interface |
jjako | 52c2414 | 2002-12-16 13:33:51 +0000 | [diff] [blame] | 292 | |