aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/gtpu/gtpu_encap.c
AgeCommit message (Collapse)AuthorFilesLines
2023-11-10gtpu: support non-G-PDU packets and PDU SessionRune E. Jensen1-41/+177
Updated the gtpu plugin code to support the PDU Session user plane protocol, required for 5G, as specified in 3GPP TS 38.415 version 17.0.0. This enables some initial support of 5G gNodeB's with the gtpu plugin. New features: - Basic support for the GTP-U Extension Header Flag. Packets with one extension can now be decapsulated. This enables basic support of the PDU Session user plane protocol (3GPP TS 38.415 version 17.0.0). New tunnels can be created with a PDU enable flag and a 6-bit QoS Flow Identifier (QFI). With this, encapsulated packets will have the PDU Session extension header, and the QFI set. - Ability to forward GTP-U packets that are not handled by the plugin directly. Only GTP-U packets with a message type of 255 (G-PDU) are handled directly. However, 3GPP TS 29.281 defines several other message types like echo and error indication. A new feature is added to optionally forward unknown or unsupported packets to a new IP address. This works separately for unknown GTP-U message types, unknown TEIDs, and packets with an unknown GTP-U header. This allows both echo and error indications from a 5G gNodeB to be handled by a different system outside VPP. - Simple way to get metrics for active tunnels and on tunnel close. In 5G session/tunnel lifetime is often short and created frequently. The normal API becomes too slow and inaccurate when too many tunnels are created and deleted every second. Improvements: - A clean ground structure to handle multiple message type in the future. The code path for G-PDU packets is optimized for performance, representing the typical case. Unsupported GTP-U packets enter a slow path that decodes the nature of the error. This presents a easy hook to handle other message types in the future. - Improved error reporting When using traces there is more details in the tunnel descriptions. - Updated the API with several enums. Fixes: - gtpu0->length field in IPv6 was computed with IPv4 header lengths in the encapsulation code. - vec_set_len (t->rewrite, ...) size was computed with the IPv4 header size also for IPv6 tunnels. Issues: - This PR does not enable full support of the 3GPP specification. In particular it only supports a single QoS/QFI flow for each tunnel. It ignores all incoming extension header flags. - API functions might change again when/if more support of the 3GPP TS 38.415 spec is added. Note that I have bumped the API version to 2.1.0 as it seems to be the correct approach based on my API changes. Type: feature Signed-off-by: Rune E. Jensen <runeerle@wgtwo.com> Change-Id: I91cd2b31f2561f1b3fb1e46c4c34a5a3c71b4625
2020-06-16gtpu: support separate rx-decap and encap-tx teid valuesJohn Lo1-5/+5
Support separate local and remote TEIDs, with local (or RX) one used for GTPU tunnel RX/decap and remote (or TX) one used encap/TX. Updated current gtpu API to support seperate RX/TX TEIDs and added new gtpu_tunnel_update_tteid API to allow changing TX-TEID of an existing GTPU tunnel. The current tunnel field "teid" is used for RX-TEID and a new field "tteid" is used for TX-TEID. Type: improvement Signed-off-by: John Lo <loj@cisco.com> Change-Id: I549d79750a34bb965036da298c0ca894d15c2c20
2019-12-20vxlan: reuse inner packet flow hash for tunnel outer header load balanceShawn Ji1-0/+9
Type: fix Several tunnels encapsulation use udp as outer header and udp src port is set by inner header flow hash, such as gtpu, geneve, vxlan, vxlan-gbd Since flow hash of inner header is already been calculated, keeping it to vnet_buffere[b]->ip.flow_hash should save load-balance node work to select ECMP uplinks. Change-Id: I0e4e2b27178f4fcc5785e221d6d1f3e8747d0d59 Signed-off-by: Shawn Ji <xiaji@tethrnet.com>
2019-07-22gtpu: fix missing trace issueZhiyong Yang1-0/+16
Type: fix Change-Id: I1e1c39452edd94712455d102a6faad58bc7f66ff Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
2019-03-01gtpu: migrate old MULTIARCH macros to VLIB_NODE_FNFilip Tehlar1-27/+2
Change-Id: Id6e82910f8d991e355d3f26222eea4ac3ab091b1 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2018-07-19Fix IPv6 csum calculation in GTP-U encapsulationAndreas Schultz1-24/+25
The length field is included in the checksum. Therefor, we need to update it before calculating the checksum. Change-Id: Id23234efb80ea3747a0f8a5c7bf8621748d27635 Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
2018-07-18Fix GTP-U length header field in encodingAndreas Schultz1-10/+20
The length in the GTPU header does not specify the length of the payload. It does specify the number of bytes following the fixed part (the first 8 bytes) of the GTPU header (see 3GPP TS 29.060, Sect. 9.3.1). Change-Id: I8ce73df015e1cf1f38d306666962c0058756111c Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
2018-07-18Fix GTP-U header in 4x IPv4 vector encapsulationAndreas Schultz1-1/+1
The fourth GTP-U packet had a wrong reference, leading to data corruption. Change-Id: Id82f87368183d5e8b7047133c5ea799f2a9cb43c Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com>
2017-08-25Use Quad-loop to improve gtpu-encap performanceHongjun Ni1-49/+194
Change-Id: I440fae09e77502392af5cde45dd9c532afa5d976 Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2017-06-02Add l3 routing for GTP-U decapHongjun Ni1-1/+1
Change-Id: Ic3c8cd58cb2b02622299cf74c9efcabd2ef2b513 Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2017-05-22Fix GTP-U Coverity issuesHongjun Ni1-24/+15
Change-Id: I982e0dfb96c371672aa636aa7e40f06a84e2bb69 Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2017-05-15Add GTP-U plugin. VPP-694Hongjun Ni1-0/+569
Basic GTP-U feature Change-Id: I31226f890a92c5303ac06e112ed7820cae52d9bd Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>