aboutsummaryrefslogtreecommitdiffstats
path: root/README
blob: d2a412c458e4827a6532ba83c1239ca40120aec6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
*** QuickStart ***

REQUIREMENTS

Linux
OpenGGSN was developed and tested using Redhat 7.1 and Redhat
7.2. It should run also on other Linux distributions as well as
FreeBSD and Solaris, but this is untested. Please tell me of any
testing results.

Tun
Both ggsn and sgsnemu uses the tun package. You need at least tun
version 1.1. See http://vtun.sourceforge.net/tun/ for instructions on
installation. Tun is included in the kernel from early version 2.4, so
you will not normally need to install it. For Redhat 7.1, 7.2 and 8.0
you do however need to do the following:
mkdir /dev/net
mknod /dev/net/tun c 10 200
Add this line to /etc/modules.conf: alias char-major-10-200 tun 
depmod -a


COMPILATION and INSTALLATION

1 ./configure
2 cd gtp
3 make
4 make install
5 cd ..
6 make
7 make install
8 Add /usr/local/lib to /etc/ld.so.conf
9 Run ldconfig

You need to be root in order to install the package, but not in order
to compile.

Steps 2 to 5 are only needed the first time you install the
package. Most likely steps 8 and 9 can be omitted as the path to
libgtp is now included in Makefile.am for sgsnemu and ggsn.

RUNNING

sgsnemu
Edit the configuration file sgsnemu.conf found under
openggsn/examples. Use sgsnemu -h for a list of available options.
Start the emulator as root using the command:

  sgsnemu -c examples/sgsnemu.conf -l 10.20.30.50 -r 10.20.30.40

This will cause the sgsn emulator to bind to local address 10.20.30.50
and connect to the ggsn found at 10.20.30.40. It will first send off
an ECHO_REQUEST message. After this it will attempt to establish a pdp
context. If successful it will create a local interface and set up
routing. Now you should be able to ping through the connection. Use a
network analysator such as ethereal to monitor the traffic.

ggsn
Edit the configuration file ggsn.conf found under
openggsn/examples. Use sgsnemu -h for a list of available options.
Start the ggsn as root using the command:

  ggsn --fg -c examples/ggsn.conf -l 10.20.30.40 --statedir .

This will run the ggsn in foreground using the local interface
10.20.30.40. Of cause you can use sgsnemu to test the GGSN.


SUPPORT
If you have any questions drop me a line at jj@openggsn.org.


*** Features ***

OpenGGSN is an open source implementation of GPRS Support Nodes
(GSNs). It implements the GPRS tunneling protocol (GTP) version 0.

OpenGGSN provides 3 components:
* gtplib
* ggsn
* sgsnemu

gtplib
This library contains all functionality relating to the GTP
protocol. Use this libraty if you want to implement your own
GSN. Currently gtplib supports GTPv0. At the moment no interface
documentation is available for download.

ggsn
The ggsn implements a Gateway GPRS Support Node. The GGSN is a small
application which is provided in order to test and demonstrate the use
of gtplib. It is fully compliant to the 3GPP standards, but lacks
important functionality such as charging and management. Use this
application as a starting point if you want to build your own GGSN
with your own fancy VPN, management and charging functionality.

sgsnemu
This application emulates a Serving GPRS Support Node (SGSN). sgsnemu
enables you to test your 3GPP core network without the need to invest
in a 3G radio access network. An important application of sgsnemu is
the testing of roaming connectivity through a GPRS roaming exchange.


*** Required software ***

TUN  (http://vtun.sourceforge.net/tun/)

Both ggsn and sgsnemu uses the tun package. You need at least tun
version 1.1. See the above web page for instructions on
installation. Tun is included in the kernel from early version 2.4, so
you will not normally need to install it. For Redhat 7.1, 7.2 and 8.0
you do however need to do the following:
mkdir /dev/net
mknod /dev/net/tun c 10 200
Add the following line to /etc/modules.conf: alias char-major-10-200 tun 
depmod -a


GENGETOPT (http://www.gnu.org/software/gengetopt/gengetopt.html)

Gengetopt is required if you want to change the options defined in the
cmdline.ggo source file. You need at least gengetopt version 2.8. If
you are just going to compile the programs you don't need gengetopt.

To use gengetopt for the ggsn do the following:
cd ggsn
gengetopt < cmdline.ggo --conf-parser

To use gengetopt for the sgsnemu do the following:
cd sgsnemu
gengetopt < cmdline.ggo --conf-parser


*** Compilation and Installation ***

SETTING UP AUTOTOOLS

You do not need to perform this step if you are only going to compile
the package:

0 Get version from somewhere: Script to extract version from configure.ac
1 Copy the latest config.guess and config.sub from ftp://ftp.gnu.org/gnu/config
2 Run autoscan and copy configure.scan to configure.ac
3 Add/edit the following lines in configure.ac:
	AC_INIT(openggsn, 0.52, jj@openggsn.org)
	AC_CONFIG_SRCDIR([gtp/gtp.c])
	AM_CONFIG_HEADER([config.h])
	AC_PROG_LIBTOOL
	AM_PROG_LIBTOOL
	AM_INIT_AUTOMAKE()
4 libtoolize --automake --copy
  (ads copy of ltmain.sh)
5 aclocal
6 autoheader
7 automake --add-missing
  (Ads link to missing, install-sh, depcomp)
8 automake
9 autoconf

The above will initialise the project to the current version of
autotools (As installed in RedHat 8.0). See
http://sources.redhat.com/autobook/autobook/autobook_25.html#SEC25 
for details on autotools.


COMPILATION AND INSTALLATION

 1 ./configure
 2 make clean
 3 cd gtp
 4 make
 5 make install (as root)
 6 cd ..
   (Step 3 to 6 you only need to run the first time to install libgtp)
 7 make
 8 make install (as root)
 9 Add /usr/local/lib to /etc/ld.so.conf
10 run ldconfig
   (Step 9 and 10 are not required as path to libgtp is included in Makefile)


*** Running ggsn ***

Use ggsn -h for a list of available options. All options available on
the command line can also be given in a configuration file. See
examples/ggsn.conf for the format of this file.

*** Running sgsnemu ***

Use sgsnemu -h for a list of available options. All options available
on the command line can also be given in a configuration file. See
examples/sgsnemu.conf for the format of this file.

If you want to test a GRX roaming connection you will need to do the
following:

1) Install sgsnemu on a Linux Box. See under installation above.

2) Connect your Linux box with sgsnemu installed to the GPRS core
network. Use the same LAN switch as the one your SGSN is connected
to. You also need a free IP address that can be used by sgsnemu.

3) You need to configure networking in terms of interface address,
subnet mask and default route. See the Linux Networking HOWTO for
details.

4) Launch sgsnemu with something like:

     sgsnemu --fg --listen 10.20.30.50 --remote 10.20.30.40 --dns 10.20.38.51 --timelimit 10 --contexts 0 

sgsnemu will print something like the following on the screen:

  Using DNS server:      10.20.38.51 (10.20.38.51)
  Local IP address is:   10.20.30.50 (10.20.30.50)
  Remote IP address is:  10.20.30.40 (10.20.30.40)
  IMSI is:               240011234567890 (0x98765432110042)
  Using APN:             internet
  Using MSISDN:          46702123456

  Initialising GTP library
  OpenGGSN[1823]: GTP: gtp_newgsn() started
  Done initialising GTP library

  Sending off echo request
  Waiting for response from ggsn........

  Received echo response. Cause value: 0

This is quite good. It means that you managed to send off an echo
request to a remote GGSN, and it was friendly enough to answer you. If
you did not get an echo response it means that something is wrong
either with your setup OR with the GRX connection OR with your roaming
partners connection.

If the above went well you might want to try to establish a PDP
context to the remote GGSN. Note that you should be carefull when
establishing PDP contexts using sgsnemu as each established PDP
context will result in a Charge Detail Record (CDR) being generated by
the GGSN. You should use real IMSI and MSISDN from a valid test SIM
card. Otherwise some poor customer might get charged for your
testing. Also note that you are establishing a connection to the Gi
netowrk, so please be carefull not to route internet traffic onto the
GPRS core network! Assuming you know what you are doing:

     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

sgsnemu will print something like the following on the screen:

  Using DNS server:      10.20.38.51 (10.20.38.51)
  Local IP address is:   10.20.30.50 (10.20.30.50)
  Remote IP address is:  10.20.30.40 (10.20.30.40)
  IMSI is:               240011234567890 (0x98765432110042)
  Using APN:             internet
  Using MSISDN:          46702123456

  Initialising GTP library
  OpenGGSN[1838]: GTP: gtp_newgsn() started
  Done initialising GTP library

  Sending off echo request
  Setting up PDP context #0
  Waiting for response from ggsn........

  Received echo response. Cause value: 0
  Received create PDP context response. Cause value: 128
  Setting up interface and routing
  /sbin/ifconfig tun0 192.168.0.1
  /sbin/route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.0.1


Now a context is established to the remote GGSN. The IP address of the
context is 192.168.0.1. If you specified the correct --net and --mask
you should be able to ping a known address on the Gi network of the
roaming partner. You should even be able to do web browsing through
the PDP context.

Note however that you probably need to adjust your routing tables, so
that you make sure that all GRX traffic is routed to the GPRS core
network and everything else through the PDP context. The proper way to
do this is to use policy routing. Also note that you are effectively
connecting the same computer to both the Gn and Gi network, so please
be carefull not to route internet traffic onto the GPRS core network
and please protect yourself against hackers! For this reason it is
advised to always use --contexts 0 when testing a live network.

After --timelimit seconds the PDP context is disconnected with the
following messages from sgsnemu:

  Disconnecting PDP context #0
  Received delete PDP context response. Cause value: 128
  Deleting tun interface