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

What's hot (20)

SRv6 study
SRv6 studySRv6 study
SRv6 study
 
Cilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDPCilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDP
 
Drive into calico architecture
Drive into calico architectureDrive into calico architecture
Drive into calico architecture
 
DPDK In Depth
DPDK In DepthDPDK In Depth
DPDK In Depth
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
Introduction to eBPF and XDP
Introduction to eBPF and XDPIntroduction to eBPF and XDP
Introduction to eBPF and XDP
 
The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitch
 
FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)
 
EBPF and Linux Networking
EBPF and Linux NetworkingEBPF and Linux Networking
EBPF and Linux Networking
 
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on Lab
 
Intel dpdk Tutorial
Intel dpdk TutorialIntel dpdk Tutorial
Intel dpdk Tutorial
 
Install FD.IO VPP On Intel(r) Architecture & Test with Trex*
Install FD.IO VPP On Intel(r) Architecture & Test with Trex*Install FD.IO VPP On Intel(r) Architecture & Test with Trex*
Install FD.IO VPP On Intel(r) Architecture & Test with Trex*
 
Cisco Live! :: Introduction to Segment Routing :: BRKRST-2124 | Las Vegas 2017
Cisco Live! :: Introduction to Segment Routing :: BRKRST-2124  | Las Vegas 2017Cisco Live! :: Introduction to Segment Routing :: BRKRST-2124  | Las Vegas 2017
Cisco Live! :: Introduction to Segment Routing :: BRKRST-2124 | Las Vegas 2017
 
FD.io VPP事始め
FD.io VPP事始めFD.io VPP事始め
FD.io VPP事始め
 
Fun with PRB, VRFs and NetNS on Linux - What is it, how does it work, what ca...
Fun with PRB, VRFs and NetNS on Linux - What is it, how does it work, what ca...Fun with PRB, VRFs and NetNS on Linux - What is it, how does it work, what ca...
Fun with PRB, VRFs and NetNS on Linux - What is it, how does it work, what ca...
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking Walkthrough
 
Intel DPDK Step by Step instructions
Intel DPDK Step by Step instructionsIntel DPDK Step by Step instructions
Intel DPDK Step by Step instructions
 
3GPP F1インターフェース(TS38.470-f50)の概要
3GPP F1インターフェース(TS38.470-f50)の概要3GPP F1インターフェース(TS38.470-f50)の概要
3GPP F1インターフェース(TS38.470-f50)の概要
 
Advanced: 5G Service Based Architecture (SBA)
Advanced: 5G Service Based Architecture (SBA)Advanced: 5G Service Based Architecture (SBA)
Advanced: 5G Service Based Architecture (SBA)
 
RSS++
RSS++RSS++
RSS++
 

Similar to Using GTP on Linux with libgtpnl

ELC-E Linux Awareness
ELC-E Linux AwarenessELC-E Linux Awareness
ELC-E Linux Awareness
Peter Griffin
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily use
Mediacurrent
 

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

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 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
 
"OPEN NETWORKING" に向けた Management / Data Plane の動向
"OPEN NETWORKING" に向けた Management / Data Plane の動向"OPEN NETWORKING" に向けた Management / Data Plane の動向
"OPEN NETWORKING" に向けた Management / Data Plane の動向
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 

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