blob: d142e9136d1178864bf25ffc1f8cfe4fd783cd88 [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
jjakobcbfb412003-01-06 21:21:03 +000015you will not normally need to install it. For Redhat 7.1 and 7.2 you
16do 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./configure
jjako0ac82a12003-01-05 18:36:33 +000025cd gtp
jjako52c24142002-12-16 13:33:51 +000026make
jjako0ac82a12003-01-05 18:36:33 +000027make install
28cd ..
29make
jjako52c24142002-12-16 13:33:51 +000030make install
31Add /usr/local/lib to /etc/ld.so.conf
32Run ldconfig
33
jjakobcbfb412003-01-06 21:21:03 +000034
jjako52c24142002-12-16 13:33:51 +000035RUNNING
36
37sgsnemu
38Edit the configuration file sgsnemu.conf found under
jjako0ac82a12003-01-05 18:36:33 +000039openggsn/examples. Use sgsnemu -h for a list of available options.
jjako52c24142002-12-16 13:33:51 +000040Start the emulator using the command:
41
jjako0ac82a12003-01-05 18:36:33 +000042 sgsnemu -c examples/sgsnemu.conf -l 10.20.30.50 -r 10.20.30.40
jjako52c24142002-12-16 13:33:51 +000043
44This will cause the sgsn emulator to bind to local address 10.20.30.50
45and connect to the ggsn found at 10.20.30.40. It will first send off
jjakobcbfb412003-01-06 21:21:03 +000046an ECHO_REQUEST message. After this it will attempt to establish a pdp
jjako52c24142002-12-16 13:33:51 +000047context. If successful it will create a local interface and set up
48routing. Now you should be able to ping through the connection. Use a
49network analysator such as ethereal to monitor the traffic.
50
51ggsn
jjako0ac82a12003-01-05 18:36:33 +000052Edit the configuration file ggsn.conf found under
53openggsn/examples. Use sgsnemu -h for a list of available options.
jjako52c24142002-12-16 13:33:51 +000054Start the ggsn using the command:
jjako0ac82a12003-01-05 18:36:33 +000055
56 ggsn --fg -c examples/ggsn.conf -l 10.20.30.40 --statedir .
57
jjako52c24142002-12-16 13:33:51 +000058This will run the ggsn in foreground using the local interface
jjakobcbfb412003-01-06 21:21:03 +00005910.20.30.40. Of cause you can use sgsnemu to test the GGSN.
60
61
62SUPPORT
63If you have any questions drop me a line at jj@openggsn.org.
jjako52c24142002-12-16 13:33:51 +000064
65
66*** Features ***
67
68OpenGGSN is an open source implementation of GPRS Support Nodes
69(GSNs). It implements the GPRS tunneling protocol (GTP) version 0.
70
71OpenGGSN provides 3 components:
72* gtplib
73* ggsn
74* sgsnemu
75
76gtplib
jjako0ac82a12003-01-05 18:36:33 +000077This library contains all functionality relating to the GTP
jjako52c24142002-12-16 13:33:51 +000078protocol. Use this libraty if you want to implement your own
jjakobcbfb412003-01-06 21:21:03 +000079GSN. Currently gtplib supports GTPv0. At the moment no interface
80documentation is available for download.
jjako52c24142002-12-16 13:33:51 +000081
82ggsn
jjako0ac82a12003-01-05 18:36:33 +000083The ggsn implements a Gateway GPRS Support Node. The GGSN is a small
84application which is provided in order to test and demonstrate the use
85of gtplib. It is fully compliant to the 3GPP standards, but lacks
86important functionality such as charging and management. Use this
jjako52c24142002-12-16 13:33:51 +000087application as a starting point if you want to build your own GGSN
88with your own fancy VPN, management and charging functionality.
89
jjako0ac82a12003-01-05 18:36:33 +000090sgsnemu
91This application emulates a Serving GPRS Support Node (SGSN). sgsnemu
jjakobcbfb412003-01-06 21:21:03 +000092enables you to test your 3GPP core network without the need to invest
jjako52c24142002-12-16 13:33:51 +000093in a 3G radio access network. An important application of sgsnemu is
94the testing of roaming connectivity through a GPRS roaming exchange.
95
jjako0ac82a12003-01-05 18:36:33 +000096
jjako52c24142002-12-16 13:33:51 +000097*** Required software ***
98
jjakobcbfb412003-01-06 21:21:03 +000099TUN (http://vtun.sourceforge.net/tun/)
jjako52c24142002-12-16 13:33:51 +0000100
101Both ggsn and sgsnemu uses the tun package. You need at least tun
jjako0ac82a12003-01-05 18:36:33 +0000102version 1.1. See the above web page for instructions on
103installation. Tun is included in the kernel from early version 2.4, so
104you will not normally need to install it. For Redhat 7.1 and 7.2 you
105do however need to do the following:
106mkdir /dev/net
107mknod /dev/net/tun c 10 200
108Add the following line to /etc/modules.conf: alias char-major-10-200 tun
109depmod -a
110
jjako52c24142002-12-16 13:33:51 +0000111
jjakobcbfb412003-01-06 21:21:03 +0000112GENGETOPT (http://www.gnu.org/software/gengetopt/gengetopt.html)
jjako52c24142002-12-16 13:33:51 +0000113
114Gengetopt is required if you want to change the options defined in the
jjakobcbfb412003-01-06 21:21:03 +0000115cmdline.ggo source file. You need at least gengetopt version 2.8. If
116you are just going to compile the programs you don't need gengetopt.
jjako52c24142002-12-16 13:33:51 +0000117
jjako0ac82a12003-01-05 18:36:33 +0000118To use gengetopt for the ggsn do the following:
jjako52c24142002-12-16 13:33:51 +0000119cd ggsn
jjako0ac82a12003-01-05 18:36:33 +0000120gengetopt < cmdline.ggo --conf-parser
jjako52c24142002-12-16 13:33:51 +0000121
jjako0ac82a12003-01-05 18:36:33 +0000122To use gengetopt for the sgsnemu do the following:
jjako52c24142002-12-16 13:33:51 +0000123cd sgsnemu
jjako0ac82a12003-01-05 18:36:33 +0000124gengetopt < cmdline.ggo --conf-parser
jjako52c24142002-12-16 13:33:51 +0000125
jjako52c24142002-12-16 13:33:51 +0000126
127*** Compilation and Installation ***
128
129To generate everything:
130See 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
jjako0ac82a12003-01-05 18:36:33 +0000140 (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)
jjako52c24142002-12-16 13:33:51 +0000142 9 run make install
14310 Add /usr/local/lib to /etc/ld.so.conf
14411 run ldconfig
145
146
jjako52c24142002-12-16 13:33:51 +0000147On RedHat add /usr/local/lib to /etc/ld.so.conf
148http://www.dwheeler.com/program-library/Program-Library-HOWTO/shared-libraries.html
149
150*** Running ggsn ***
jjakobcbfb412003-01-06 21:21:03 +0000151
152Use ggsn -h for a list of available options. All options available on
153the command line can also be given in a configuration file. See
154examples/ggsn.conf for the format of this file.
jjako52c24142002-12-16 13:33:51 +0000155
156*** Running sgsnemu ***
jjakobcbfb412003-01-06 21:21:03 +0000157
158Use sgsnemu -h for a list of available options. All options available
159on the command line can also be given in a configuration file. See
160examples/sgsnemu.conf for the format of this file.
161
162If you want to test a GRX roaming connection you will need to do the
163following:
164
1651) Install sgsnemu on a Linux Box. See under installation above.
166
1672) Connect your Linux box with sgsnemu installed to the GPRS core
168network. Use the same LAN switch as the one your SGSN is connected
169to. You also need a free IP address that can be used by sgsnemu.
170
1713) You need to configure networking in terms of interface address,
172subnet mask and default route. See the Linux Networking HOWTO for
173details.
174
1754) 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
179sgsnemu 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
197This is quite good. It means that you managed to send off an echo
198request to a remote GGSN, and it was friendly enough to answer you. If
199you did not get an echo response it means that something is wrong
200either with your setup OR with the GRX connection OR with your roaming
201partners connection.
202
203If the above went well you might want to try to establish a PDP
204context to the remote GGSN. Note that you should be carefull when
205establishing PDP contexts using sgsnemu as each established PDP
206context will result in a Charge Detail Record (CDR) being generated by
207the GGSN. You should use real IMSI and MSISDN from a valid test SIM
208card. Otherwise some poor customer might get charged for your
209testing. Also note that you are establishing a connection to the Gi
210netowrk, so please be carefull not to route internet traffic onto the
211GPRS 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
215sgsnemu 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
239Now a context is established to the remote GGSN. The IP address of the
240context is 192.168.0.1. If you specified the correct --net and --mask
241you should be able to ping a known address on the Gi network of the
242roaming partner. You should even be able to do web browsing through
243the PDP context.
244
245Note however that you probably need to adjust your routing tables, so
246that you make sure that all GRX traffic is routed to the GPRS core
247network and everything else through the PDP context. The proper way to
248do this is to use policy routing. Also note that you are effectively
249connecting the same computer to both the Gn and Gi network, so please
250be carefull not to route internet traffic onto the GPRS core network
251and please protect yourself against hackers! For this reason it is
252advised to always use --contexts 0 when testing a live network.
253
254After --timelimit seconds the PDP context is disconnected with the
255following messages from sgsnemu:
256
257 Disconnecting PDP context #0
258 Received delete PDP context response. Cause value: 128
259 Deleting tun interface
jjako52c24142002-12-16 13:33:51 +0000260