Project

General

Profile

Basic Testing » History » Version 3

laforge, 02/24/2017 04:30 PM

1 1 laforge
h1. Basic Testing
2
3
This page documents some basic testing setup for the Kenrel GTP-U code. It follows the below rationale:
4
* focus on testing the kernel GTP-U module without too much external dependencies
5
* test GTP-U interoperability of the kernel with at least one other implementation, not just kernel-to-kernel (which currently is not supported in the kernel, as it only implements the GGSN/P-GW role)
6
* limit testing to SGSN/S-GW and GGSN/P-GW, without a real cellular network (which is possible e.g. using [[OsmoSGSN:]] and [[OsmoPCU:]])
7
8
h2. Building / Installing dependencies
9
10
In order to follow below test instructions, you will need
11
* A Linux kernel including the GTP-U driver (@drivers/net/gtp.c@) either compiled-in or as kernel module
12
* [[libgtpnl]] - the userspace library providing an API around the kernel GTP-U netlink interface
13
* [[OpenGGSN:]] - a minimal C-language implementation of a 3GPP GGSN, also contains a SGSN-side emulator called [[OpenGGSN:sgsnemu]]
14
15 2 laforge
You can find some instructions on how to build [[OpenGGSN:]] with support for [[libgtpnl]] and kernel GTP-U at this wiki page: [[OpenGGSN:Kernel_GTP]]
16
17 1 laforge
h2. Test setup description
18
19
We will run the GGSN natively on the host, and put the emulated SGSN inside a separate network namespace.
20
21
The two namespaces are interconnected by a virtual ethernet device using the transfer network 172.31.1.0/24
22
23
The GGSN is configured to provide a pool of IP addresses from the 192.168.71.0/24 range.  Each PDP context will be allocated one dynamic address from that pool
24
25
26
h2. Test instructions
27
28
h3. create the network namespace for the SGSN
29
30
 ip netns add sgsn
31
32
h3. add veth to be used between SGSN and GGSN
33
34
 ip link add veth0 type veth peer name veth1
35
36
h3. remote (SGSN) side of veth device
37
38
<pre>
39
ip link set veth1 netns sgsn
40
ip netns exec sgsn ip addr add 172.31.1.2/24 dev veth1
41
ip netns exec sgsn ip link set veth1 up
42
</pre>
43
44
h3. local (GGSN) side of veth device
45
46
<pre>
47
ip addr add  172.31.1.1/24 dev veth0
48
ip link set veth0 up
49
</pre>
50
51
h3. execute the GGSN on the host
52
53 3 laforge
 ggsn -g -c ./ggsn.conf.test
54 1 laforge
55
(use the file attached to this wiki page)
56
57
h3. execute the emulated SGSN inside the sgsn namespace
58
59
 ip netns exec sgsn sgsnemu -d -r 172.31.1.1 -l 172.31.1.2 --defaultroute --createif
60
61
h3. verify the existnace of the GTP tunnel
62
63
<pre>
64
ggsn:~# gtp-tunnel list
65
version 1 tei 1/1 ms_addr 192.168.71.2 sgsn_addr 172.31.1.2
66
</pre>
67
68
h3. further testing
69
70
in the @sgsn@ namespace, there's now a default-route that points into the GTP tunnel. You can use this to ping any network address that's reachable to the GGSN host.  If that host is connected to the internet, you can e.g. run a ping command from within the namespace using 
71
72
 ip netns exec sgsn ping -c 10 8.8.8.8
73
74
which will send some IP packets to 8.8.8.8 via the tun0 device (created by [[OpenGGSN:sgsnemu]]). It will be encapsulated by the userspace GTP-U implementation of sgsnemu, sent via the veth device to the host, where it ends up inthe GTP-U kernel module, decapsulating the package and passing in on to the gtp0 device there.  Anything beyond that point depends on your local routing configuration.
Add picture from clipboard (Maximum size: 48.8 MB)