Project

General

Profile

Kernel GTP » History » Version 10

laforge, 03/16/2021 08:22 PM

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