Project

General

Profile

Kernel GTP » History » Version 11

laforge, 03/16/2021 08:23 PM
mention debian 10

1 5 laforge
h1. OsmoGGSN and Linux Kernel accelerated GTP-U
2 2 laforge
3 5 laforge
{{>toc}}
4 1 laforge
5 8 osmith
OsmoGGSN has support to use the Linux kernel GTP-U code to accelerate the data/user plane while still implementing the control plane (GTP-C) in userspace in OsmoGGSN.
6 5 laforge
7 2 laforge
For more information about the Linux kernel GTP-U code, please see [[linux-kernel-gtp-u:]]
8
9 5 laforge
h2. Building OsmoGGSN with kernel which has GTP-U support
10 1 laforge
11 6 laforge
At the time of writing (2018-04-26) of this wiki, below listed distributions have support of GTP kernels :
12 1 laforge
13 6 laforge
* Debian
14
** Debian 9 "stretch" (kernel 4.9.0-6) 
15 11 laforge
** Debian 10 "buster"
16 6 laforge
** Debian "unstable"
17
* Ubuntu
18
** Ubuntu 16.04 "xenial" (kernel 4.8, 4.10, 4.13)
19
** Ubuntu 17.10 "artful" (kernel 4.13)
20
* OpenSUSE
21
** OpenSUSE Tumbleweed (kernel "stable" 4.8, 4.12)
22
* Fedora
23
** Fedora 25 (kernel 4.13 "kconfig":https://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/fedora.git/diff/fedora/configs/kernel-4.13.16-x86_64.config?h=f25&id=c7f8c6df25a148b887515787667c75e18fa9790d)
24
** Fedora 26 (kernel 4.15 "kconfig":https://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/fedora.git/diff/fedora/configs/kernel-4.15.18-x86_64.config?h=f26&id=7b0ed3e9a5d6773dddcc904c1d4e67c1307f02dd)
25
** Fedora 27 (kernel 4.16 "kconfig":https://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/fedora.git/tree/fedora/configs/kernel-4.16.4-x86_64.config?h=f27&id=d06904e7457b50b9cfc108667b5b65777a43cc75)
26 1 laforge
27 6 laforge
If you're using any other distribution, or are building your own kernels, please verify that @CONFIG_GTP@ is set to either @m@ or @y@.
28 1 laforge
29 6 laforge
*If @CONFIG_GTP@ is not enabled, you cannot use kernel GTP-U!*
30
31 1 laforge
Check if package @libc-ares-dev@ is installed and if not please add it.
32
33 6 laforge
h3. Installing dependencies and build library @libosmocore@
34 1 laforge
35 5 laforge
You can install required dependency packages with:
36 1 laforge
37
<pre>
38 8 osmith
$ sudo apt install libtalloc-dev libpcsclite-dev
39 1 laforge
</pre>
40
41 5 laforge
Please follow instructions provided at [[cellular-infrastructure:Build from source]] in order to install libosmocore
42 1 laforge
43
44 5 laforge
h3.  Installing dependencies and build library @libgtpnl@
45 1 laforge
46 5 laforge
You can install dependencies with:
47
48 1 laforge
<pre>
49 8 osmith
$ sudo apt install libmnl-dev
50 1 laforge
</pre>
51
52 5 laforge
Then build libgtpnl like this
53
<pre>
54 8 osmith
$ git clone git://git.osmocom.org/libgtpnl.git
55
$ cd libgtpnl
56
$ autoreconf -fi
57
$ ./configure
58
$ make
59
$ sudo make install
60
$ sudo ldconfig
61 5 laforge
</pre>
62 1 laforge
63 5 laforge
h3. osmo-ggsn
64
65
Build OsmoGGSN like this:
66
67 1 laforge
<pre>
68 8 osmith
$ git clone git://git.osmocom.org/osmo-ggsn.git
69
$ cd osmo-ggsn
70
$ ./configure --enable-gtp-linux
71
$ make
72
$ sudo make install
73
$ sudo ldconfig
74 1 laforge
</pre>
75
76
Following message is shown at end of the command: @ ./configure --enable-gtp-linux@ 
77
78
<pre>
79 5 laforge
OsmoGGSN Configuration:
80 1 laforge
  GTP Linux kernel support:			yes
81
</pre>
82
83
This means that appropriate header files are available.
84
85 8 osmith
h2. Using OsmoGGSN with kernel which has GTP-U support
86 1 laforge
87
In order to find out whether gtp.ko module is available we can enter following command:
88
89
<pre>
90 8 osmith
$ find /lib/modules/$(uname -r) -name gtp.ko
91 1 laforge
</pre>
92
93
Output below shows that gtp.ko module is present:
94
95
<pre>
96
/lib/modules/4.8.0-30-generic/kernel/drivers/net/gtp.ko
97
</pre>
98
99
100 5 laforge
We are loading module gtp from kernel issuing command: <pre>sudo modprobe gtp</pre> 
101 1 laforge
102
when you enter: 
103
<pre>
104 8 osmith
$ lsmod | grep gtp
105 1 laforge
</pre>
106
107
then more information about gtp and related udp tunnel can be obtained:
108
109
<pre>
110
gtp                    28672  0
111
udp_tunnel             16384  1 gtp
112
</pre>
113
114
115
Some helpful tools are available in: @libgtpnl/tools@
116
117 8 osmith
you can get more details about gtp-tunnel, entering command from the OsmoGGSN shell:
118 1 laforge
119
<pre>
120 8 osmith
$ sudo ./gtp-tunnel list
121 1 laforge
</pre>
122
123
Output will be similar to:
124
<pre>
125
version 1 tei 1/0 ms_addr 192.168.0.2 sgsn_addr 127.0.0.2
126
</pre>
127 5 laforge
128 1 laforge
Note: OsmoGGSN is started by: 
129
<pre>
130 8 osmith
$ sudo osmo-ggsn -c osmo-ggsn.cfg
131 1 laforge
</pre>
132
133
Related output should be similar to the one shown below: 
134
135
<pre>
136 9 osmith
<0002> ggsn.c:186 APN(internet): Starting
137
<0002> ggsn.c:204 APN(internet): Opening Kernel GTP device tun4
138
<0002> ggsn.c:215 APN(internet): Skipping APN start
139
<0002> ggsn.c:794 GGSN(ggsn0): Starting GGSN
140
<000d> gtp.c:902 GTP: gtp_newgsn() started at 127.0.0.2
141
<0002> ggsn.c:830 GGSN(ggsn0): Successfully started
142
<0002> ggsn.c:186 APN(internet): Starting
143
<0002> ggsn.c:204 APN(internet): Opening Kernel GTP device tun4
144
<0002> gtp-kernel.c:79 Initialized GTP kernel mode (genl ID is 25)
145
<0001> tun.c:217 GTP kernel configured
146
<0002> ggsn.c:236 APN(internet): Setting tun IP address 172.16.222.0/24
147
<0002> ggsn.c:294 APN(internet): Creating IPv4 pool 172.16.222.0/24
148
<0002> ggsn.c:168 APN(internet): Blacklist tun IP 172.16.222.0/24
149
<0002> ggsn.c:325 APN(internet): Successfully started
150
<0005> telnet_interface.c:104 Available via telnet 127.0.0.1 4260
151
<000c> control_if.c:916 CTRL at 127.0.0.1 4257
152 1 laforge
</pre>
153
154 6 laforge
You can now start to establish PDP contexts to your new osmo-ggsn instance, from [[OsmoSGSN:]], @sgsnemu@ or third-party SGSNs
155 10 laforge
156
h2. Automatic Testing
157
158
See [[linux-kernel-gtp-u:Automatic_Testing]] for the automatic continuous integration test setup.
Add picture from clipboard (Maximum size: 48.8 MB)