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