Kernel GTP » History » Revision 10
Revision 9 (osmith, 03/01/2021 02:57 PM) → Revision 10/12 (laforge, 03/16/2021 08:22 PM)
h1. OsmoGGSN and Linux Kernel accelerated GTP-U
{{>toc}}
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.
For more information about the Linux kernel GTP-U code, please see [[linux-kernel-gtp-u:]]
h2. Building OsmoGGSN with kernel which has GTP-U support
At the time of writing (2018-04-26) of this wiki, below listed distributions have support of GTP kernels :
* Debian
** Debian 9 "stretch" (kernel 4.9.0-6)
** Debian "unstable"
* Ubuntu
** Ubuntu 16.04 "xenial" (kernel 4.8, 4.10, 4.13)
** Ubuntu 17.10 "artful" (kernel 4.13)
* OpenSUSE
** OpenSUSE Tumbleweed (kernel "stable" 4.8, 4.12)
* Fedora
** 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)
** 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)
** 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)
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@.
*If @CONFIG_GTP@ is not enabled, you cannot use kernel GTP-U!*
Check if package @libc-ares-dev@ is installed and if not please add it.
h3. Installing dependencies and build library @libosmocore@
You can install required dependency packages with:
<pre>
$ sudo apt install libtalloc-dev libpcsclite-dev
</pre>
Please follow instructions provided at [[cellular-infrastructure:Build from source]] in order to install libosmocore
h3. Installing dependencies and build library @libgtpnl@
You can install dependencies with:
<pre>
$ sudo apt install libmnl-dev
</pre>
Then build libgtpnl like this
<pre>
$ git clone git://git.osmocom.org/libgtpnl.git
$ cd libgtpnl
$ autoreconf -fi
$ ./configure
$ make
$ sudo make install
$ sudo ldconfig
</pre>
h3. osmo-ggsn
Build OsmoGGSN like this:
<pre>
$ git clone git://git.osmocom.org/osmo-ggsn.git
$ cd osmo-ggsn
$ ./configure --enable-gtp-linux
$ make
$ sudo make install
$ sudo ldconfig
</pre>
Following message is shown at end of the command: @ ./configure --enable-gtp-linux@
<pre>
OsmoGGSN Configuration:
GTP Linux kernel support: yes
</pre>
This means that appropriate header files are available.
h2. Using OsmoGGSN with kernel which has GTP-U support
In order to find out whether gtp.ko module is available we can enter following command:
<pre>
$ find /lib/modules/$(uname -r) -name gtp.ko
</pre>
Output below shows that gtp.ko module is present:
<pre>
/lib/modules/4.8.0-30-generic/kernel/drivers/net/gtp.ko
</pre>
We are loading module gtp from kernel issuing command: <pre>sudo modprobe gtp</pre>
when you enter:
<pre>
$ lsmod | grep gtp
</pre>
then more information about gtp and related udp tunnel can be obtained:
<pre>
gtp 28672 0
udp_tunnel 16384 1 gtp
</pre>
Some helpful tools are available in: @libgtpnl/tools@
you can get more details about gtp-tunnel, entering command from the OsmoGGSN shell:
<pre>
$ sudo ./gtp-tunnel list
</pre>
Output will be similar to:
<pre>
version 1 tei 1/0 ms_addr 192.168.0.2 sgsn_addr 127.0.0.2
</pre>
Note: OsmoGGSN is started by:
<pre>
$ sudo osmo-ggsn -c osmo-ggsn.cfg
</pre>
Related output should be similar to the one shown below:
<pre>
<0002> ggsn.c:186 APN(internet): Starting
<0002> ggsn.c:204 APN(internet): Opening Kernel GTP device tun4
<0002> ggsn.c:215 APN(internet): Skipping APN start
<0002> ggsn.c:794 GGSN(ggsn0): Starting GGSN
<000d> gtp.c:902 GTP: gtp_newgsn() started at 127.0.0.2
<0002> ggsn.c:830 GGSN(ggsn0): Successfully started
<0002> ggsn.c:186 APN(internet): Starting
<0002> ggsn.c:204 APN(internet): Opening Kernel GTP device tun4
<0002> gtp-kernel.c:79 Initialized GTP kernel mode (genl ID is 25)
<0001> tun.c:217 GTP kernel configured
<0002> ggsn.c:236 APN(internet): Setting tun IP address 172.16.222.0/24
<0002> ggsn.c:294 APN(internet): Creating IPv4 pool 172.16.222.0/24
<0002> ggsn.c:168 APN(internet): Blacklist tun IP 172.16.222.0/24
<0002> ggsn.c:325 APN(internet): Successfully started
<0005> telnet_interface.c:104 Available via telnet 127.0.0.1 4260
<000c> control_if.c:916 CTRL at 127.0.0.1 4257
</pre>
You can now start to establish PDP contexts to your new osmo-ggsn instance, from [[OsmoSGSN:]], @sgsnemu@ or third-party SGSNs
h2. Automatic Testing
See [[linux-kernel-gtp-u:Automatic_Testing]] for the automatic continuous integration test setup.