From e23a51e4f8b9c15ea044e1e61af80bf312abf84a Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 12 Feb 2016 10:04:04 +0100 Subject: intiial check-in of GTP slides of netdevconf 1.1 --- 2016/netdevconf-gtp/abstract.txt | 31 + 2016/netdevconf-gtp/kernel-gtp.png | Bin 0 -> 5491 bytes 2016/netdevconf-gtp/netdev-gtp.adoc | 236 ++ 2016/netdevconf-gtp/netdev-gtp.html | 4357 +++++++++++++++++++++++++++++++++ 2016/netdevconf-gtp/netdev-gtp__1.png | Bin 0 -> 17972 bytes 2016/netdevconf-gtp/netdev-gtp__2.png | Bin 0 -> 15644 bytes 2016/netdevconf-gtp/netdev-gtp__3.png | Bin 0 -> 20858 bytes 2016/netdevconf-gtp/netdev-gtp__4.png | Bin 0 -> 23580 bytes 2016/netdevconf-gtp/netdev-gtp__5.png | Bin 0 -> 2164 bytes 2016/netdevconf-gtp/netdev-gtp__6.png | Bin 0 -> 34454 bytes 10 files changed, 4624 insertions(+) create mode 100644 2016/netdevconf-gtp/abstract.txt create mode 100644 2016/netdevconf-gtp/kernel-gtp.png create mode 100644 2016/netdevconf-gtp/netdev-gtp.adoc create mode 100644 2016/netdevconf-gtp/netdev-gtp.html create mode 100644 2016/netdevconf-gtp/netdev-gtp__1.png create mode 100644 2016/netdevconf-gtp/netdev-gtp__2.png create mode 100644 2016/netdevconf-gtp/netdev-gtp__3.png create mode 100644 2016/netdevconf-gtp/netdev-gtp__4.png create mode 100644 2016/netdevconf-gtp/netdev-gtp__5.png create mode 100644 2016/netdevconf-gtp/netdev-gtp__6.png diff --git a/2016/netdevconf-gtp/abstract.txt b/2016/netdevconf-gtp/abstract.txt new file mode 100644 index 0000000..9532160 --- /dev/null +++ b/2016/netdevconf-gtp/abstract.txt @@ -0,0 +1,31 @@ +Osmocom kernel-level GTP implementation + +When users access the Internet via cellular networks from their mobile +devices, all this traffic is encapsulated and tunneled through a variety +of cellular-network specific protocol layers. Many of those protocol +implementations run on proprietary special-purpose hardware and +software. + +One protocol has been in use between certain network elements ever since +the advent of GPRS services. This protocol remained in use with EDGE, +UMTS, HSPA and is even still in use in LTE: The GPRS Tunneling Protocol +(GTP). + +GTP is split in a control plane and a user plane. The user plane at +todays cellular internet speeds can no longer be implemented efficiently +in userspace but requires a kernel-level implementation, much the same +like we have kernel-level implementations for GRE, IPIP, PPP, L2TP and +others. + +This presentation is about a Linux kernel level implementation of GTP-U +that was started by Harald Welte and Pablo Neira within the Osmocom +(Open Source Mobile Communications, http://www.osmocom.org/) project. + +After being abandoned for some time, recent interest (and contributions, +particularly by Andreas Schultz) to this kernel GTP code has brought it +back on track, and its authors aim for Linux kernel mainline inclusion. + +We will also cover some context in terms of where GTP is used in +practise, and which programs are already using the kernel-level GTP +code. + diff --git a/2016/netdevconf-gtp/kernel-gtp.png b/2016/netdevconf-gtp/kernel-gtp.png new file mode 100644 index 0000000..a9f5570 Binary files /dev/null and b/2016/netdevconf-gtp/kernel-gtp.png differ diff --git a/2016/netdevconf-gtp/netdev-gtp.adoc b/2016/netdevconf-gtp/netdev-gtp.adoc new file mode 100644 index 0000000..897a0b1 --- /dev/null +++ b/2016/netdevconf-gtp/netdev-gtp.adoc @@ -0,0 +1,236 @@ +Osmocom kernel-level GTP implementation +======================================= +Andreas Schultz + Harald Welte +:copyright: Andreas Schultz + Harald Welte (Liense: CC-BY-SA) +:backend: slidy +:max-width: 45em + +== What is GTP / GTP in GPRS + +* GTP, the 'GPRS Tunneling Protocol' was first introduced with GPRS, the + packet-switched add-on to GSM networks +* 'PDP contexts' are sessions with an external packet data network (IP) + which provide a tunnel between the phone and that external network +* GTP is used betwen the SGSN and GGSN to tunnel the User-plane (IP) + packet data of a PDP Context +* latest definition in (3GPP TS 29.281 version 12.1.0 Release 12) + +[graphviz] +---- +digraph G { + label="GPRS Network" + rankdir=LR; + MS0 [label="MS"] + MS0->BTS0 [label="Um", dir=both] + BTS0 [label="BTS + CCU"] + BTS0->PCU [dir=both] + PCU->SGSN [label="Gb", dir=both] + SGSN->GGSN [label="GTP", dir=both] +} +---- + + +== GTP in UMTS + +* In UMTS, PDP originally remained between SGSN and GGSN +[graphviz] +---- +digraph G { + label="UMTS Network" + rankdir=LR; + UE [label="UE"] + NB [label="NodeB"] + RNC [label="RNC"] + + UE->NB [label="Uu", dir=both] + NB->RNC [label="Iub", dir=both] + + RNC->SGSN [label="IuPS", dir=both] + SGSN->GGSN [label="GTP", dir=both] +} +---- +* With HSPA in later releases (Rel7+), user plane is moved out of SGSN + and NodeB generates GTP directly +* hNodeB (femtocell) architecture also originates GTP directly in hNodeB +[graphviz] +---- +digraph G { + label="UMTS Network / Later Release" + rankdir=LR; + UE [label="UE"] + NB [label="NodeB"] + RNC [label="RNC"] + + UE->NB [label="Uu", dir=both] + NB->RNC [label="Iub", dir=both] + + RNC->SGSN [label="IuPS", dir=both] + SGSN->GGSN [label="GTP-C", dir=both] + NB->GGSN [label="GTP-U", dir=both] +} +---- + + +== GTP in LTE + +* LTE uses GTP at even more interfaces between network elements +* LTE introduces GTP-C Version 2 for control plane, but user plane + remains GTP-U v1 like before. +* What used to be the GGSN is now called PDN-GW in LTE +[graphviz] +---- +digraph G { + label="LTE Network" + rankdir=LR; + UE [label="UE"] + NB [label="eNodeB"] + + UE->NB [label="Uu", dir=both] + NB -> MME [label="S1", dir=both] + NB -> SGW [label="S1-U (GTP-U)", dir=both] + MME -> SGW [label="S11", dir=both] + SGW->PGW [label="S5 (GTP-U)", dir=both] +} +---- + + + +== GTP + +* control (GTP-C) *and* user (GTP-U) plane protocol +* UDP based on well known ports (3386, 2152) +* per PDP context/tunnel identifiers (TID) +** one for each direction(!) in GTP v1 +** is the only identifier for tunnel, not IP/Port tuples! +* support for packet sequnce numbers and reordering + + +== GTP-C + +control protocol for: + +* exchanging meta data +* assigning parameters to client: + - IPv4 addresses + - IPv6 prefixes + - DNS servers + - ... +* establishing and removing tunnels +* moving tunnel endpoints to other SGW's + + +== GTP-U + +two main jobs: + +* per client tunnelling of IP packets +* path maintenance + - echo requests/replies + - error reporting + +[packetdiag] +---- +{ + colwidth = 32 + node_height = 64 + + 0-7: Flags + 8-15: Type + 16-31: Length + 32-63: Tunnel ID +} +---- + +== Problems with Userspace GTP + +* Userspace GTP was fine with GPRS speeds +** Packet rates / bandwidths small compared to routing +* With HSPA and particularly LTE, the world has changed +** Signalling / Control Plane traffic is very limited +** User Plane traffic is very high bandwidth + + +== Osmocom kernel-level GTP + +* Move bandwidth-critical User Plane into Linux kernel +* Keep Control Plane stays in Userspace (OpenGGSN) +* Use netlink based API to control user plane in kernel + +* Started by Harald Welte + Pablo Neira @ sysmocom in 2012 +** unfortunately abandoned due to customer disappearing +* picked up by Andreas Schultz @ travelping in 2015 +** fixed Harald + Pablo's bugs +** introduce network namespace support + + +== Design + +* netlink API built on top of genl +* initialization: +** create GTP socket in userspace +** create tun like network interface +** bind GTP sockets to it +* for each PDP context, user space adds one record +** IP address assigned to MS for this PDP context +** TEIDs to identify mobile-originated packets +** SGSN IP for GTP header of mobile-terminated packets + +== Design + +* netlink API built on top of genl +* all PDP contexts share one tun device +** one tun device for all subscribers, not one per subscriber + +[graphviz] +---- +digraph G { + rankdir=LR; + MS0 [label="MS 10.0.0.1"]; + MS1 [label="MS 10.0.0.2"]; + MS2 [label="MS 10.0.0.3"]; + GGSN; + tun0 [shape=box]; + + MS0 -> SGSN [dir=both]; + MS1 -> SGSN [dir=both]; + MS2 -> SGSN [dir=both]; + + SGSN -> GGSN [label="GTP-U", dir=both]; + GGSN -> tun0 [dir=none, minlen=0]; + tun0 -> SRV [label = "10.0.0.1 - 1.2.3.4", dir=both] + tun0 -> SRV [label = "10.0.0.2 - 1.2.3.4", dir=both] + tun0 -> SRV [label = "10.0.0.3 - 1.2.3.4", dir=both] +} +---- + +== STATUS + +* working +** GTP-U v0 and v1 for IPv4 over IPv4 +** multiple tunnels supported +** only single APN (multiple IP ranges not permited) + +* Limitations +** no IPv6 support +** no offload support + +* existing users (both GPLv2) +** OpenGGSN (http://cgit.osmocom.org/openggsn/) +** new 'ergw' Erlang GGSN / P-GW (https://github.com/travelping/ergw) + + +== TODO + +* TODO: +** final round of clean-up, submission for mainline +** fix or remove IPv6 support +* discussion items: +** path MTU discovery +** implications by/for offloading faetures (csum / gso / ...) +* wishlist +** light-weight tunneling integration + + +== The End + +Questions? diff --git a/2016/netdevconf-gtp/netdev-gtp.html b/2016/netdevconf-gtp/netdev-gtp.html new file mode 100644 index 0000000..54e1de4 --- /dev/null +++ b/2016/netdevconf-gtp/netdev-gtp.html @@ -0,0 +1,4357 @@ + + + + +Osmocom kernel-level GTP implementation + + + + + + + + +
+

What is GTP / GTP in GPRS

+
+
    +
  • + +GTP, the GPRS Tunneling Protocol was first introduced with GPRS, the + packet-switched add-on to GSM networks + +
  • +
  • + +PDP contexts are sessions with an external packet data network (IP) + which provide a tunnel between the phone and that external network + +
  • +
  • + +GTP is used betwen the SGSN and GGSN to tunnel the User-plane (IP) + packet data of a PDP Context + +
  • +
  • + +latest definition in (3GPP TS 29.281 version 12.1.0 Release 12) + +
  • +
+
+
+netdev-gtp__1.png +
+
+
+
+
+

GTP in UMTS

+
+
    +
  • + +In UMTS, PDP originally remained between SGSN and GGSN + +
  • +
+
+
+netdev-gtp__2.png +
+
+
    +
  • + +With HSPA in later releases (Rel7+), user plane is moved out of SGSN + and NodeB generates GTP directly + +
  • +
  • + +hNodeB (femtocell) architecture also originates GTP directly in hNodeB + +
  • +
+
+
+netdev-gtp__3.png +
+
+
+
+
+

GTP in LTE

+
+
    +
  • + +LTE uses GTP at even more interfaces between network elements + +
  • +
  • + +LTE introduces GTP-C Version 2 for control plane, but user plane + remains GTP-U v1 like before. + +
  • +
  • + +What used to be the GGSN is now called PDN-GW in LTE + +
  • +
+
+
+netdev-gtp__4.png +
+
+
+
+
+

GTP

+
+
    +
  • + +control (GTP-C) and user (GTP-U) plane protocol + +
  • +
  • + +UDP based on well known ports (3386, 2152) + +
  • +
  • + +per PDP context/tunnel identifiers (TID) + +
      +
    • + +one for each direction(!) in GTP v1 + +
    • +
    • + +is the only identifier for tunnel, not IP/Port tuples! + +
    • +
    +
  • +
  • + +support for packet sequnce numbers and reordering + +
  • +
+
+
+
+

GTP-C

+
+

control protocol for:

+
    +
  • + +exchanging meta data + +
  • +
  • + +assigning parameters to client: + +
      +
    • + +IPv4 addresses + +
    • +
    • + +IPv6 prefixes + +
    • +
    • + +DNS servers + +
    • +
    • + +… + +
    • +
    +
  • +
  • + +establishing and removing tunnels + +
  • +
  • + +moving tunnel endpoints to other SGW’s + +
  • +
+
+
+
+

GTP-U

+
+

two main jobs:

+
    +
  • + +per client tunnelling of IP packets + +
  • +
  • + +path maintenance + +
      +
    • + +echo requests/replies + +
    • +
    • + +error reporting + +
    • +
    +
  • +
+
+
+netdev-gtp__5.png +
+
+
+
+
+

Problems with Userspace GTP

+
+
    +
  • + +Userspace GTP was fine with GPRS speeds + +
      +
    • + +Packet rates / bandwidths small compared to routing + +
    • +
    +
  • +
  • + +With HSPA and particularly LTE, the world has changed + +
      +
    • + +Signalling / Control Plane traffic is very limited + +
    • +
    • + +User Plane traffic is very high bandwidth + +
    • +
    +
  • +
+
+
+
+

Osmocom kernel-level GTP

+
+
    +
  • + +Move bandwidth-critical User Plane into Linux kernel + +
  • +
  • + +Keep Control Plane stays in Userspace (OpenGGSN) + +
  • +
  • + +Use netlink based API to control user plane in kernel + +
  • +
  • + +Started by Harald Welte + Pablo Neira @ sysmocom in 2012 + +
      +
    • + +unfortunately abandoned due to customer disappearing + +
    • +
    +
  • +
  • + +picked up by Andreas Schultz @ travelping in 2015 + +
      +
    • + +fixed Harald + Pablo’s bugs + +
    • +
    • + +introduce network namespace support + +
    • +
    +
  • +
+
+
+
+

Design

+
+
    +
  • + +netlink API built on top of genl + +
  • +
  • + +initialization: + +
      +
    • + +create GTP socket in userspace + +
    • +
    • + +create tun like network interface + +
    • +
    • + +bind GTP sockets to it + +
    • +
    +
  • +
  • + +for each PDP context, user space adds one record + +
      +
    • + +IP address assigned to MS for this PDP context + +
    • +
    • + +TEIDs to identify mobile-originated packets + +
    • +
    • + +SGSN IP for GTP header of mobile-terminated packets + +
    • +
    +
  • +
+
+
+
+

Design

+
+
    +
  • + +netlink API built on top of genl + +
  • +
  • + +all PDP contexts share one tun device + +
      +
    • + +one tun device for all subscribers, not one per subscriber + +
    • +
    +
  • +
+
+
+netdev-gtp__6.png +
+
+
+
+
+

STATUS

+
+
    +
  • + +working + +
      +
    • + +GTP-U v0 and v1 for IPv4 over IPv4 + +
    • +
    • + +multiple tunnels supported + +
    • +
    • + +only single APN (multiple IP ranges not permited) + +
    • +
    +
  • +
  • + +Limitations + +
      +
    • + +no IPv6 support + +
    • +
    • + +no offload support + +
    • +
    +
  • +
  • + +existing users (both GPLv2) + + +
  • +
+
+
+
+

TODO

+
+
    +
  • + +TODO: + +
      +
    • + +final round of clean-up, submission for mainline + +
    • +
    • + +fix or remove IPv6 support + +
    • +
    +
  • +
  • + +discussion items: + +
      +
    • + +path MTU discovery + +
    • +
    • + +implications by/for offloading faetures (csum / gso / …) + +
    • +
    +
  • +
  • + +wishlist + +
      +
    • + +light-weight tunneling integration + +
    • +
    +
  • +
+
+
+
+

The End

+
+

Questions?

+
+
+ + diff --git a/2016/netdevconf-gtp/netdev-gtp__1.png b/2016/netdevconf-gtp/netdev-gtp__1.png new file mode 100644 index 0000000..45509e3 Binary files /dev/null and b/2016/netdevconf-gtp/netdev-gtp__1.png differ diff --git a/2016/netdevconf-gtp/netdev-gtp__2.png b/2016/netdevconf-gtp/netdev-gtp__2.png new file mode 100644 index 0000000..0800f7a Binary files /dev/null and b/2016/netdevconf-gtp/netdev-gtp__2.png differ diff --git a/2016/netdevconf-gtp/netdev-gtp__3.png b/2016/netdevconf-gtp/netdev-gtp__3.png new file mode 100644 index 0000000..74fd21b Binary files /dev/null and b/2016/netdevconf-gtp/netdev-gtp__3.png differ diff --git a/2016/netdevconf-gtp/netdev-gtp__4.png b/2016/netdevconf-gtp/netdev-gtp__4.png new file mode 100644 index 0000000..fe331aa Binary files /dev/null and b/2016/netdevconf-gtp/netdev-gtp__4.png differ diff --git a/2016/netdevconf-gtp/netdev-gtp__5.png b/2016/netdevconf-gtp/netdev-gtp__5.png new file mode 100644 index 0000000..463158d Binary files /dev/null and b/2016/netdevconf-gtp/netdev-gtp__5.png differ diff --git a/2016/netdevconf-gtp/netdev-gtp__6.png b/2016/netdevconf-gtp/netdev-gtp__6.png new file mode 100644 index 0000000..ab3145d Binary files /dev/null and b/2016/netdevconf-gtp/netdev-gtp__6.png differ -- cgit v1.2.3