Kernel GTP » History » Revision 5
Revision 4 (laforge, 04/24/2018 05:03 PM) → Revision 5/12 (laforge, 04/25/2018 12:11 PM)
h1. OsmoGGSN OpenGGSN and Linux Kernel accelerated GTP-U {{>toc}} OsmoGGSN OpenGGSN 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 OpenGGSN. For more information about the Linux kernel GTP-U code, please see [[linux-kernel-gtp-u:]] h2. Building OsmoGGSN OpenGGSN with kernel which has GTP-U support At the time of writing (2017-01-09) of this wiki, below listed distributions have support of GTP kernels : * Debian 4.9.1-1~exp1 - Debian's latest experimental build * Ubuntu 16.10 kernel 4.8 * OpenSUSE Tumbleweed (stable) 4.8 (.12) * Fedora 25 kernel 4.8 Following two Debian kernels do not activate GTP kernel module during build: 4.8.0 and 4.9.0. *It is expected that complete openbsc project and related dependencies are pre-installed.* Check if package @libc-ares-dev@ is installed and if not please add it. Ubuntu 16.10, kernel 4.8.0-30-generic is used. h3. * Installing dependencies and build library @libosmocore@ @libgtpnl@ You can install required dependency those packages with: <pre> sudo apt install libtalloc-dev libpcsclite-dev libpcsclite libmnl-dev </pre> Please follow instructions provided at [[cellular-infrastructure:Build from source]] in order to install libosmocore h3. Installing dependencies following library and build library @libgtpnl@ projects : You can install Information about dependencies with: between Osmocom projects is given at the above link: <pre> sudo apt install libmnl-dev </pre> * libgtpnl 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 * libosmocore * openggsn 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 openggsn Configuration: GTP Linux kernel support: yes </pre> This means that appropriate header files are available. h2. Using OpenGGSN 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> 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 OpenGGSN 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> Furthermore we can use: <pre> sudo strace ggsn --gtp-linux -c ggsn.conf -f -d </pre> to determine if Ubuntu 16.10, kernel 4.8.0-30 is in use. Next two cases shall be considered as an indication whether gtp kernel module is active: ** If gtp kernel module is active then we can see the strace output just when PDP context activation or deactivation is done. ** If gtp kernel module is not active then we can see the strace output constantly running on the screen. Note: OsmoGGSN OpenGGSN is started by: <pre> sudo osmo-ggsn ggsn --gtp-linux -c osmo-ggsn.conf ggsn.conf -f -d </pre> -d option is useful for debugging purposes. Related output should be similar to the one shown below: <pre> FIXME conf: ggsn.conf fg: 1 debug: 1 qos: 0x0b921f apn: internet net: 192.168.0.0/24 pidfile: /var/run/ggsn.pid statedir: /var/lib/ggsn/ gtp_linux: 1 timelimit: 0 cmdline_parser_configfile listen: 127.0.0.1 conf: ggsn.conf fg: 1 debug: 1 qos: 0x0b921f apn: internet net: 192.168.0.0/24 pidfile: /var/run/ggsn.pid statedir: /var/lib/ggsn/ gtp-linux: 1 timelimit: 0 <000c> gtp.c:701 GTP: gtp_newgsn() started <0002> gtp-kernel.c:123 Using the GTP kernel mode (genl ID is 27) <0002> gtp-kernel.c:156 GTP kernel configured <000b> control_if.c:693 CTRL at 127.0.0.1 4257 </pre> You osmosgsn can now start be started with: <pre> sudo osmo-sgsn -c sgsn.cfg </pre> - d option is also available ins osmo-sgsn command. Additional information related to establish PDP contexts to your new osmo-ggsn instance, from [[OsmoSGSN:]], @sgsnemu@ or third-party SGSNs setup of openbsc and GPRS setup is available [[cellular-infrastructure:OpenBSC GPRS]] For clarity purposes configuration files of openbsc, OpenGGSN, osmosgsn and sysmoBTS are added.