SlideShare a Scribd company logo
1 of 8
Download to read offline
Using GTP on Linux
( libgtpnl )
SRv6 Consortium, Data plane Study Group
Kentaro Ebisawa | Twitter: @ebiken
Using GTP on Linux (libgtpnl) | SRv6 Consortium, Data plane Study Group | 2018/12/31 (rev 0) 1
• Linux has kernel level implementation of GTP tunnel endpoint
• Since Linux Kernel 4.7
• “drivers/net/gtp.c”
• https://github.com/torvalds/linux/blob/master/Documentation/networking/gtp.txt
• https://osmocom.org/projects/linux-kernel-gtp-u/wiki
• Features
• Encap / Decap of GTP-U (GTP User Plane)
• GTP-U v0 [GSM TS 09.60] and v1 [3GPP TS 29.281]
• IPv4 only : No GTP over IPv6 nor IPv6 user traffic on GTP payload
Since GTPv0 is deprecated, this slide will only show GTPv1
Using GTP on Linux (libgtpnl) | SRv6 Consortium, Data plane Study Group | 2018/12/31 (rev 0) 2
GTP on Linux
• You can use netlink to configure GTP Kernel module.
• The most simple way is to use tools in libgtpnl
• No need to run control plane software.
• http://git.osmocom.org/libgtpnl/
• https://osmocom.org/projects/linux-kernel-gtp-u/wiki/Libgtpnl
Using GTP on Linux (libgtpnl) | SRv6 Consortium, Data plane Study Group | 2018/12/31 (rev 0) 3
How to configure GTP-U on Linux
Using GTP on Linux (libgtpnl) | SRv6 Consortium, Data plane Study Group | 2018/12/31 (rev 0) 4
Building libgtpnl
> Install prerequisites
$ sudo apt install libmnl-dev autoconf libtool
> Clone source code, configure and build
$ git clone git://git.osmocom.org/libgtpnl.git
$ cd libgtpnl
libgtpnl$ autoreconf –fi
libgtpnl$ ./configure
libgtpnl$ make
libgtpnl$ sudo make install
libgtpnl$ sudo ldconfig
> Check gtp-link and gtp-tunnel are built
libgtpnl$ sudo -s
libgtpnl# cd tools
libgtpnl/tools# ./gtp-link
Usage: ./gtp-link <add|del> <device>
libgtpnl/tools# ./gtp-tunnel
./gtp-tunnel <add|delete|list> [<options,...>]
> If LIBMNL error happens during ./configure, do below.
./configure: line 2950: syntax error near unexpected token `LIBMNL,'
./configure: line 2950: `PKG_CHECK_MODULES(LIBMNL, libmnl >= 1.0.0)’
$ whereis libmnl
libmnl: /usr/lib/x86_64-linux-gnu/libmnl.a /usr/lib/x86_64-linux-
gnu/libmnl.so /usr/local/lib/libmnl.so /usr/local/lib/libmnl.la
/usr/include/libmnl
$ ldd /usr/local/lib/libmnl.so
linux-vdso.so.1 (0x00007fffdadf9000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6f9af5d000)
/lib64/ld-linux-x86-64.so.2 (0x00007f6f9b554000)
> make sure you run autoreconf again before running ./configure
libgtpnl$ autoreconf –fi
libgtpnl$ ./configure
Using GTP on Linux (libgtpnl) | SRv6 Consortium, Data plane Study Group | 2018/12/31 (rev 0) 5
Configure GTP endpoints inside netns
netns: default netns: ns2
veth1
172.0.0.1/24
veth2
172.0.0.2/24
gtp1
(gtp device)
gtp2
(gtp device)
lo (loopback)
172.99.0.2/32
lo (loopback)
172.99.0.1/32
TEID# 100
TEID#200
TEID# 100
TEID#200
$ sudo –s
ip link add veth1 type veth peer name veth2
ip addr add 172.0.0.1/24 dev veth1
ip link set veth1 up
ip addr add 172.99.0.1/32 dev lo
> Create gtp device
./gtp-link add gtp1
> Open a new console and configure tunnel (PDP session)
./gtp-tunnel add gtp1 v1 200 100 172.99.0.2 172.0.0.2
ip route add 172.99.0.2/32 dev gtp1
$ sudo –s
ip netns add ns2
ip link set veth2 netns ns2
ip netns exec ns2 ip addr add 172.0.0.2/24 dev veth2
ip netns exec ns2 ip link set veth2 up
ip netns exec ns2 ip addr add 172.99.0.2/32 dev lo
ip netns exec ns2 ip link set lo up
> Create gtp device
ip netns exec ns2 ./gtp-link add gtp2
> Open a new console and configure tunnel (PDP session)
ip netns exec ns2 ./gtp-tunnel add gtp2 v1 100 200 172.99.0.1 172.0.0.1
ip netns exec ns2 ip route add 172.99.0.1/32 dev gtp2
Using GTP on Linux (libgtpnl) | SRv6 Consortium, Data plane Study Group | 2018/12/31 (rev 0) 6
command to configuration mapping (gtp1 => gtp2)
netns: default netns: ns2
veth1
172.0.0.1/24
veth2
172.0.0.2/24
gtp1
(gtp device)
gtp2
(gtp device)
lo (loopback)
172.99.0.2/32
lo (loopback)
172.99.0.1/32
TEID# 100
TEID#200
TEID# 100
TEID#200
./gtp-tunnel add gtp1 v1 200 100 172.99.0.2 172.0.0.2
./gtp-tunnel add <gtp device> <v1> <i_tei> <o_tei> <ms-addr> <sgsn-addr>
gtp device
i_tei
o_tei sgsn-addr
ms-addr
output TEID
input TEID
Tunnel Endpoint
MS: Mobile Station
(UE in LTE)
Packet with dst IP = <ms-addr> will be encapsulated in
GTP packet with dst IP = <sgsn-addr> and TEID = <o_tei>
Using GTP on Linux (libgtpnl) | SRv6 Consortium, Data plane Study Group | 2018/12/31 (rev 0) 7
Confirm tunnel (PDP session) configuration
netns: default netns: ns2
veth1
172.0.0.1/24
veth2
172.0.0.2/24
gtp1
(gtp device)
gtp2
(gtp device)
lo (loopback)
172.99.0.2/32
lo (loopback)
172.99.0.1/32
TEID# 100
TEID#200
TEID# 100
TEID#200
libgtpnl/tools# ./gtp-tunnel list
version 1 tei 200/100 ms_addr 172.99.0.2 sgsn_addr 172.0.0.2
libgtpnl/tools# ip netns exec ns2 ./gtp-tunnel list
version 1 tei 100/200 ms_addr 172.99.0.1 sgsn_addr 172.0.0.1
Using GTP on Linux (libgtpnl) | SRv6 Consortium, Data plane Study Group | 2018/12/31 (rev 0) 8
GTP Packet Dump
netns: default netns: ns2
veth1
172.0.0.1/24
veth2
172.0.0.2/24
gtp1
(gtp device)
gtp2
(gtp device)
lo (loopback)
172.99.0.2/32
lo (loopback)
172.99.0.1/32
TEID# 100
TEID#200
TEID# 100
TEID#200
# ping 172.99.0.2
ICMP echo request
ICMP echo reply

More Related Content

What's hot

Replacing iptables with eBPF in Kubernetes with Cilium
Replacing iptables with eBPF in Kubernetes with CiliumReplacing iptables with eBPF in Kubernetes with Cilium
Replacing iptables with eBPF in Kubernetes with CiliumMichal Rostecki
 
EBPF and Linux Networking
EBPF and Linux NetworkingEBPF and Linux Networking
EBPF and Linux NetworkingPLUMgrid
 
DPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet ProcessingDPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet ProcessingMichelle Holley
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughThomas Graf
 
Understanding Open vSwitch
Understanding Open vSwitch Understanding Open vSwitch
Understanding Open vSwitch YongKi Kim
 
eBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux KerneleBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux KernelThomas Graf
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Ray Jenkins
 
VLANs in the Linux Kernel
VLANs in the Linux KernelVLANs in the Linux Kernel
VLANs in the Linux KernelKernel TLV
 
Open vSwitch - Stateful Connection Tracking & Stateful NAT
Open vSwitch - Stateful Connection Tracking & Stateful NATOpen vSwitch - Stateful Connection Tracking & Stateful NAT
Open vSwitch - Stateful Connection Tracking & Stateful NATThomas Graf
 
BPF Internals (eBPF)
BPF Internals (eBPF)BPF Internals (eBPF)
BPF Internals (eBPF)Brendan Gregg
 
Xdp and ebpf_maps
Xdp and ebpf_mapsXdp and ebpf_maps
Xdp and ebpf_mapslcplcp1
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and moreBrendan Gregg
 
netfilter and iptables
netfilter and iptablesnetfilter and iptables
netfilter and iptablesKernel TLV
 
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDPDockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDPThomas Graf
 
DPDK IPSec Security Gateway Application
DPDK IPSec Security Gateway ApplicationDPDK IPSec Security Gateway Application
DPDK IPSec Security Gateway ApplicationMichelle Holley
 
introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack monad bobo
 
Tutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerTutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerShu Sugimoto
 

What's hot (20)

Replacing iptables with eBPF in Kubernetes with Cilium
Replacing iptables with eBPF in Kubernetes with CiliumReplacing iptables with eBPF in Kubernetes with Cilium
Replacing iptables with eBPF in Kubernetes with Cilium
 
EBPF and Linux Networking
EBPF and Linux NetworkingEBPF and Linux Networking
EBPF and Linux Networking
 
DPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet ProcessingDPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet Processing
 
Dpdk performance
Dpdk performanceDpdk performance
Dpdk performance
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking Walkthrough
 
Understanding Open vSwitch
Understanding Open vSwitch Understanding Open vSwitch
Understanding Open vSwitch
 
Understanding DPDK
Understanding DPDKUnderstanding DPDK
Understanding DPDK
 
eBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux KerneleBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux Kernel
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!
 
VLANs in the Linux Kernel
VLANs in the Linux KernelVLANs in the Linux Kernel
VLANs in the Linux Kernel
 
Open vSwitch - Stateful Connection Tracking & Stateful NAT
Open vSwitch - Stateful Connection Tracking & Stateful NATOpen vSwitch - Stateful Connection Tracking & Stateful NAT
Open vSwitch - Stateful Connection Tracking & Stateful NAT
 
BPF Internals (eBPF)
BPF Internals (eBPF)BPF Internals (eBPF)
BPF Internals (eBPF)
 
Linux Network Stack
Linux Network StackLinux Network Stack
Linux Network Stack
 
Xdp and ebpf_maps
Xdp and ebpf_mapsXdp and ebpf_maps
Xdp and ebpf_maps
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and more
 
netfilter and iptables
netfilter and iptablesnetfilter and iptables
netfilter and iptables
 
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDPDockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
 
DPDK IPSec Security Gateway Application
DPDK IPSec Security Gateway ApplicationDPDK IPSec Security Gateway Application
DPDK IPSec Security Gateway Application
 
introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack introduction to linux kernel tcp/ip ptocotol stack
introduction to linux kernel tcp/ip ptocotol stack
 
Tutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerTutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting router
 

Similar to Using GTP on Linux with libgtpnl

ELC-E Linux Awareness
ELC-E Linux AwarenessELC-E Linux Awareness
ELC-E Linux AwarenessPeter Griffin
 
Make container without_docker_7
Make container without_docker_7Make container without_docker_7
Make container without_docker_7Sam Kim
 
zebra & openconfigd Introduction
zebra & openconfigd Introductionzebra & openconfigd Introduction
zebra & openconfigd IntroductionKentaro Ebisawa
 
Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Jian-Hong Pan
 
Free radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmapleFree radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmapleChanaka Lasantha
 
Docker at Digital Ocean
Docker at Digital OceanDocker at Digital Ocean
Docker at Digital OceanCloud 66
 
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios CoreNrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios CoreNagios
 
NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.
NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.
NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.Marc Trimble
 
How To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneHow To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneVEXXHOST Private Cloud
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily useMediacurrent
 
Kubernetes at Datadog Scale
Kubernetes at Datadog ScaleKubernetes at Datadog Scale
Kubernetes at Datadog ScaleDocker, Inc.
 
Shifter singularity - june 7, 2018 - bw symposium
Shifter  singularity - june 7, 2018 - bw symposiumShifter  singularity - june 7, 2018 - bw symposium
Shifter singularity - june 7, 2018 - bw symposiuminside-BigData.com
 
DcATL 2013: Git-Flow for Daily Use
DcATL 2013: Git-Flow for Daily UseDcATL 2013: Git-Flow for Daily Use
DcATL 2013: Git-Flow for Daily UseMediacurrent
 
Rust & Python : Python WA October meetup
Rust & Python : Python WA October meetupRust & Python : Python WA October meetup
Rust & Python : Python WA October meetupJohn Vandenberg
 
Spying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profitSpying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profitAndrea Righi
 
Andrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profitAndrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profitlinuxlab_conf
 

Similar to Using GTP on Linux with libgtpnl (20)

ELC-E Linux Awareness
ELC-E Linux AwarenessELC-E Linux Awareness
ELC-E Linux Awareness
 
Make container without_docker_7
Make container without_docker_7Make container without_docker_7
Make container without_docker_7
 
zebra & openconfigd Introduction
zebra & openconfigd Introductionzebra & openconfigd Introduction
zebra & openconfigd Introduction
 
netLec5.pdf
netLec5.pdfnetLec5.pdf
netLec5.pdf
 
Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021
 
Free radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmapleFree radius billing server with practical vpn exmaple
Free radius billing server with practical vpn exmaple
 
Docker at Digital Ocean
Docker at Digital OceanDocker at Digital Ocean
Docker at Digital Ocean
 
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios CoreNrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
Nrpe - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core
 
NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.
NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.
NRPE - Nagios Remote Plugin Executor. NRPE plugin for Nagios Core 4 and others.
 
Basic Linux kernel
Basic Linux kernelBasic Linux kernel
Basic Linux kernel
 
How To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneHow To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub Clone
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily use
 
Kubernetes at Datadog Scale
Kubernetes at Datadog ScaleKubernetes at Datadog Scale
Kubernetes at Datadog Scale
 
Shifter singularity - june 7, 2018 - bw symposium
Shifter  singularity - june 7, 2018 - bw symposiumShifter  singularity - june 7, 2018 - bw symposium
Shifter singularity - june 7, 2018 - bw symposium
 
DcATL 2013: Git-Flow for Daily Use
DcATL 2013: Git-Flow for Daily UseDcATL 2013: Git-Flow for Daily Use
DcATL 2013: Git-Flow for Daily Use
 
Git
GitGit
Git
 
Rust & Python : Python WA October meetup
Rust & Python : Python WA October meetupRust & Python : Python WA October meetup
Rust & Python : Python WA October meetup
 
Spying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profitSpying on the Linux kernel for fun and profit
Spying on the Linux kernel for fun and profit
 
Andrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profitAndrea Righi - Spying on the Linux kernel for fun and profit
Andrea Righi - Spying on the Linux kernel for fun and profit
 
App container rkt
App container rktApp container rkt
App container rkt
 

More from Kentaro Ebisawa

P4 Updates (2020) (Japanese)
P4 Updates (2020) (Japanese)P4 Updates (2020) (Japanese)
P4 Updates (2020) (Japanese)Kentaro Ebisawa
 
Barefoot Faster™ 日本語紹介
Barefoot Faster™ 日本語紹介Barefoot Faster™ 日本語紹介
Barefoot Faster™ 日本語紹介Kentaro Ebisawa
 
IETF106 Hackathon 報告 & P4 based Switch の課題と未来
IETF106 Hackathon 報告 & P4 based Switch の課題と未来IETF106 Hackathon 報告 & P4 based Switch の課題と未来
IETF106 Hackathon 報告 & P4 based Switch の課題と未来Kentaro Ebisawa
 
MPLS Japan 2019 : Data & Control Plane を繋ぐ API
MPLS Japan 2019 : Data & Control Plane を繋ぐ APIMPLS Japan 2019 : Data & Control Plane を繋ぐ API
MPLS Japan 2019 : Data & Control Plane を繋ぐ APIKentaro Ebisawa
 
In Network Computing Prototype Using P4 at KSC/KREONET 2019
In Network Computing Prototype Using P4 at KSC/KREONET 2019In Network Computing Prototype Using P4 at KSC/KREONET 2019
In Network Computing Prototype Using P4 at KSC/KREONET 2019Kentaro Ebisawa
 
Comparison of SRv6 Extensions uSID, SRv6+, C-SRH
Comparison of SRv6 Extensions uSID, SRv6+, C-SRHComparison of SRv6 Extensions uSID, SRv6+, C-SRH
Comparison of SRv6 Extensions uSID, SRv6+, C-SRHKentaro Ebisawa
 
Interop2019 Toyota Netcope P4
Interop2019 Toyota Netcope P4Interop2019 Toyota Netcope P4
Interop2019 Toyota Netcope P4Kentaro Ebisawa
 
IETF 104 Hackathon VPP Prototyping Stateless SRv6/GTP-U Translation
IETF 104 Hackathon VPP Prototyping Stateless SRv6/GTP-U TranslationIETF 104 Hackathon VPP Prototyping Stateless SRv6/GTP-U Translation
IETF 104 Hackathon VPP Prototyping Stateless SRv6/GTP-U TranslationKentaro Ebisawa
 
p4srv6 (P4-16) design document rev1.0
p4srv6 (P4-16) design document rev1.0p4srv6 (P4-16) design document rev1.0
p4srv6 (P4-16) design document rev1.0Kentaro Ebisawa
 
SRv6 Mobile User Plane : Initial POC and Implementation
SRv6 Mobile User Plane : Initial POC and ImplementationSRv6 Mobile User Plane : Initial POC and Implementation
SRv6 Mobile User Plane : Initial POC and ImplementationKentaro Ebisawa
 
JANOG43 Forefront of SRv6, Open Source Implementations
JANOG43 Forefront of SRv6, Open Source ImplementationsJANOG43 Forefront of SRv6, Open Source Implementations
JANOG43 Forefront of SRv6, Open Source ImplementationsKentaro Ebisawa
 
"SRv6の現状と展望" ENOG53@上越
"SRv6の現状と展望" ENOG53@上越"SRv6の現状と展望" ENOG53@上越
"SRv6の現状と展望" ENOG53@上越Kentaro Ebisawa
 
SRv6 Mobile User Plane P4 proto-type
SRv6 Mobile User Plane P4 proto-typeSRv6 Mobile User Plane P4 proto-type
SRv6 Mobile User Plane P4 proto-typeKentaro Ebisawa
 
Zebra SRv6 CLI on Linux Dataplane (ENOG#49)
Zebra SRv6 CLI on Linux Dataplane (ENOG#49)Zebra SRv6 CLI on Linux Dataplane (ENOG#49)
Zebra SRv6 CLI on Linux Dataplane (ENOG#49)Kentaro Ebisawa
 
Zebra 2.0 in Hybrid Cloud Era
Zebra 2.0 in Hybrid Cloud EraZebra 2.0 in Hybrid Cloud Era
Zebra 2.0 in Hybrid Cloud EraKentaro Ebisawa
 
p4alu: Arithmetic Logic Unit in P4
p4alu: Arithmetic Logic Unit in P4p4alu: Arithmetic Logic Unit in P4
p4alu: Arithmetic Logic Unit in P4Kentaro Ebisawa
 
ONIC2017 プログラマブル・データプレーン時代に向けた ネットワーク・オペレーションスタック
ONIC2017 プログラマブル・データプレーン時代に向けた ネットワーク・オペレーションスタックONIC2017 プログラマブル・データプレーン時代に向けた ネットワーク・オペレーションスタック
ONIC2017 プログラマブル・データプレーン時代に向けた ネットワーク・オペレーションスタックKentaro Ebisawa
 
ネットワークOS野郎 ~ インフラ野郎Night 20160414
ネットワークOS野郎 ~ インフラ野郎Night 20160414ネットワークOS野郎 ~ インフラ野郎Night 20160414
ネットワークOS野郎 ~ インフラ野郎Night 20160414Kentaro Ebisawa
 

More from Kentaro Ebisawa (20)

P4 Updates (2020) (Japanese)
P4 Updates (2020) (Japanese)P4 Updates (2020) (Japanese)
P4 Updates (2020) (Japanese)
 
Barefoot Faster™ 日本語紹介
Barefoot Faster™ 日本語紹介Barefoot Faster™ 日本語紹介
Barefoot Faster™ 日本語紹介
 
IETF106 Hackathon 報告 & P4 based Switch の課題と未来
IETF106 Hackathon 報告 & P4 based Switch の課題と未来IETF106 Hackathon 報告 & P4 based Switch の課題と未来
IETF106 Hackathon 報告 & P4 based Switch の課題と未来
 
MPLS Japan 2019 : Data & Control Plane を繋ぐ API
MPLS Japan 2019 : Data & Control Plane を繋ぐ APIMPLS Japan 2019 : Data & Control Plane を繋ぐ API
MPLS Japan 2019 : Data & Control Plane を繋ぐ API
 
Yang Tools Quick Memo
Yang Tools Quick MemoYang Tools Quick Memo
Yang Tools Quick Memo
 
In Network Computing Prototype Using P4 at KSC/KREONET 2019
In Network Computing Prototype Using P4 at KSC/KREONET 2019In Network Computing Prototype Using P4 at KSC/KREONET 2019
In Network Computing Prototype Using P4 at KSC/KREONET 2019
 
Comparison of SRv6 Extensions uSID, SRv6+, C-SRH
Comparison of SRv6 Extensions uSID, SRv6+, C-SRHComparison of SRv6 Extensions uSID, SRv6+, C-SRH
Comparison of SRv6 Extensions uSID, SRv6+, C-SRH
 
Interop2019 Toyota Netcope P4
Interop2019 Toyota Netcope P4Interop2019 Toyota Netcope P4
Interop2019 Toyota Netcope P4
 
IETF 104 Hackathon VPP Prototyping Stateless SRv6/GTP-U Translation
IETF 104 Hackathon VPP Prototyping Stateless SRv6/GTP-U TranslationIETF 104 Hackathon VPP Prototyping Stateless SRv6/GTP-U Translation
IETF 104 Hackathon VPP Prototyping Stateless SRv6/GTP-U Translation
 
p4srv6 (P4-16) design document rev1.0
p4srv6 (P4-16) design document rev1.0p4srv6 (P4-16) design document rev1.0
p4srv6 (P4-16) design document rev1.0
 
SRv6 Mobile User Plane : Initial POC and Implementation
SRv6 Mobile User Plane : Initial POC and ImplementationSRv6 Mobile User Plane : Initial POC and Implementation
SRv6 Mobile User Plane : Initial POC and Implementation
 
JANOG43 Forefront of SRv6, Open Source Implementations
JANOG43 Forefront of SRv6, Open Source ImplementationsJANOG43 Forefront of SRv6, Open Source Implementations
JANOG43 Forefront of SRv6, Open Source Implementations
 
"SRv6の現状と展望" ENOG53@上越
"SRv6の現状と展望" ENOG53@上越"SRv6の現状と展望" ENOG53@上越
"SRv6の現状と展望" ENOG53@上越
 
SRv6 Mobile User Plane P4 proto-type
SRv6 Mobile User Plane P4 proto-typeSRv6 Mobile User Plane P4 proto-type
SRv6 Mobile User Plane P4 proto-type
 
Zebra SRv6 CLI on Linux Dataplane (ENOG#49)
Zebra SRv6 CLI on Linux Dataplane (ENOG#49)Zebra SRv6 CLI on Linux Dataplane (ENOG#49)
Zebra SRv6 CLI on Linux Dataplane (ENOG#49)
 
Zebra 2.0 in Hybrid Cloud Era
Zebra 2.0 in Hybrid Cloud EraZebra 2.0 in Hybrid Cloud Era
Zebra 2.0 in Hybrid Cloud Era
 
p4alu: Arithmetic Logic Unit in P4
p4alu: Arithmetic Logic Unit in P4p4alu: Arithmetic Logic Unit in P4
p4alu: Arithmetic Logic Unit in P4
 
ONIC2017 プログラマブル・データプレーン時代に向けた ネットワーク・オペレーションスタック
ONIC2017 プログラマブル・データプレーン時代に向けた ネットワーク・オペレーションスタックONIC2017 プログラマブル・データプレーン時代に向けた ネットワーク・オペレーションスタック
ONIC2017 プログラマブル・データプレーン時代に向けた ネットワーク・オペレーションスタック
 
How to run P4 BMv2
How to run P4 BMv2How to run P4 BMv2
How to run P4 BMv2
 
ネットワークOS野郎 ~ インフラ野郎Night 20160414
ネットワークOS野郎 ~ インフラ野郎Night 20160414ネットワークOS野郎 ~ インフラ野郎Night 20160414
ネットワークOS野郎 ~ インフラ野郎Night 20160414
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

Using GTP on Linux with libgtpnl

  • 1. Using GTP on Linux ( libgtpnl ) SRv6 Consortium, Data plane Study Group Kentaro Ebisawa | Twitter: @ebiken Using GTP on Linux (libgtpnl) | SRv6 Consortium, Data plane Study Group | 2018/12/31 (rev 0) 1
  • 2. • Linux has kernel level implementation of GTP tunnel endpoint • Since Linux Kernel 4.7 • “drivers/net/gtp.c” • https://github.com/torvalds/linux/blob/master/Documentation/networking/gtp.txt • https://osmocom.org/projects/linux-kernel-gtp-u/wiki • Features • Encap / Decap of GTP-U (GTP User Plane) • GTP-U v0 [GSM TS 09.60] and v1 [3GPP TS 29.281] • IPv4 only : No GTP over IPv6 nor IPv6 user traffic on GTP payload Since GTPv0 is deprecated, this slide will only show GTPv1 Using GTP on Linux (libgtpnl) | SRv6 Consortium, Data plane Study Group | 2018/12/31 (rev 0) 2 GTP on Linux
  • 3. • You can use netlink to configure GTP Kernel module. • The most simple way is to use tools in libgtpnl • No need to run control plane software. • http://git.osmocom.org/libgtpnl/ • https://osmocom.org/projects/linux-kernel-gtp-u/wiki/Libgtpnl Using GTP on Linux (libgtpnl) | SRv6 Consortium, Data plane Study Group | 2018/12/31 (rev 0) 3 How to configure GTP-U on Linux
  • 4. Using GTP on Linux (libgtpnl) | SRv6 Consortium, Data plane Study Group | 2018/12/31 (rev 0) 4 Building libgtpnl > Install prerequisites $ sudo apt install libmnl-dev autoconf libtool > Clone source code, configure and build $ git clone git://git.osmocom.org/libgtpnl.git $ cd libgtpnl libgtpnl$ autoreconf –fi libgtpnl$ ./configure libgtpnl$ make libgtpnl$ sudo make install libgtpnl$ sudo ldconfig > Check gtp-link and gtp-tunnel are built libgtpnl$ sudo -s libgtpnl# cd tools libgtpnl/tools# ./gtp-link Usage: ./gtp-link <add|del> <device> libgtpnl/tools# ./gtp-tunnel ./gtp-tunnel <add|delete|list> [<options,...>] > If LIBMNL error happens during ./configure, do below. ./configure: line 2950: syntax error near unexpected token `LIBMNL,' ./configure: line 2950: `PKG_CHECK_MODULES(LIBMNL, libmnl >= 1.0.0)’ $ whereis libmnl libmnl: /usr/lib/x86_64-linux-gnu/libmnl.a /usr/lib/x86_64-linux- gnu/libmnl.so /usr/local/lib/libmnl.so /usr/local/lib/libmnl.la /usr/include/libmnl $ ldd /usr/local/lib/libmnl.so linux-vdso.so.1 (0x00007fffdadf9000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6f9af5d000) /lib64/ld-linux-x86-64.so.2 (0x00007f6f9b554000) > make sure you run autoreconf again before running ./configure libgtpnl$ autoreconf –fi libgtpnl$ ./configure
  • 5. Using GTP on Linux (libgtpnl) | SRv6 Consortium, Data plane Study Group | 2018/12/31 (rev 0) 5 Configure GTP endpoints inside netns netns: default netns: ns2 veth1 172.0.0.1/24 veth2 172.0.0.2/24 gtp1 (gtp device) gtp2 (gtp device) lo (loopback) 172.99.0.2/32 lo (loopback) 172.99.0.1/32 TEID# 100 TEID#200 TEID# 100 TEID#200 $ sudo –s ip link add veth1 type veth peer name veth2 ip addr add 172.0.0.1/24 dev veth1 ip link set veth1 up ip addr add 172.99.0.1/32 dev lo > Create gtp device ./gtp-link add gtp1 > Open a new console and configure tunnel (PDP session) ./gtp-tunnel add gtp1 v1 200 100 172.99.0.2 172.0.0.2 ip route add 172.99.0.2/32 dev gtp1 $ sudo –s ip netns add ns2 ip link set veth2 netns ns2 ip netns exec ns2 ip addr add 172.0.0.2/24 dev veth2 ip netns exec ns2 ip link set veth2 up ip netns exec ns2 ip addr add 172.99.0.2/32 dev lo ip netns exec ns2 ip link set lo up > Create gtp device ip netns exec ns2 ./gtp-link add gtp2 > Open a new console and configure tunnel (PDP session) ip netns exec ns2 ./gtp-tunnel add gtp2 v1 100 200 172.99.0.1 172.0.0.1 ip netns exec ns2 ip route add 172.99.0.1/32 dev gtp2
  • 6. Using GTP on Linux (libgtpnl) | SRv6 Consortium, Data plane Study Group | 2018/12/31 (rev 0) 6 command to configuration mapping (gtp1 => gtp2) netns: default netns: ns2 veth1 172.0.0.1/24 veth2 172.0.0.2/24 gtp1 (gtp device) gtp2 (gtp device) lo (loopback) 172.99.0.2/32 lo (loopback) 172.99.0.1/32 TEID# 100 TEID#200 TEID# 100 TEID#200 ./gtp-tunnel add gtp1 v1 200 100 172.99.0.2 172.0.0.2 ./gtp-tunnel add <gtp device> <v1> <i_tei> <o_tei> <ms-addr> <sgsn-addr> gtp device i_tei o_tei sgsn-addr ms-addr output TEID input TEID Tunnel Endpoint MS: Mobile Station (UE in LTE) Packet with dst IP = <ms-addr> will be encapsulated in GTP packet with dst IP = <sgsn-addr> and TEID = <o_tei>
  • 7. Using GTP on Linux (libgtpnl) | SRv6 Consortium, Data plane Study Group | 2018/12/31 (rev 0) 7 Confirm tunnel (PDP session) configuration netns: default netns: ns2 veth1 172.0.0.1/24 veth2 172.0.0.2/24 gtp1 (gtp device) gtp2 (gtp device) lo (loopback) 172.99.0.2/32 lo (loopback) 172.99.0.1/32 TEID# 100 TEID#200 TEID# 100 TEID#200 libgtpnl/tools# ./gtp-tunnel list version 1 tei 200/100 ms_addr 172.99.0.2 sgsn_addr 172.0.0.2 libgtpnl/tools# ip netns exec ns2 ./gtp-tunnel list version 1 tei 100/200 ms_addr 172.99.0.1 sgsn_addr 172.0.0.1
  • 8. Using GTP on Linux (libgtpnl) | SRv6 Consortium, Data plane Study Group | 2018/12/31 (rev 0) 8 GTP Packet Dump netns: default netns: ns2 veth1 172.0.0.1/24 veth2 172.0.0.2/24 gtp1 (gtp device) gtp2 (gtp device) lo (loopback) 172.99.0.2/32 lo (loopback) 172.99.0.1/32 TEID# 100 TEID#200 TEID# 100 TEID#200 # ping 172.99.0.2 ICMP echo request ICMP echo reply