-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c93f98
commit 56e7b08
Showing
25 changed files
with
113 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
bin/bpftool filter=lfs diff=lfs merge=lfs -text | ||
*.svg filter=lfs diff=lfs merge=lfs -text | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,59 @@ | ||
User plane function using BPF and XDP for mobile core network (4G/5G). | ||
# 5G/LTE User Plane using eBPF/XDP | ||
|
||
An open source C++ library powered by eBPF/XDP for user plane in mobile core network (5G/LTE). | ||
|
||
This project is based on the following 3GPP Technical Specification: | ||
- LTE; 5G; Interface between the Control Plane and the User Plane nodes (3GPP TS 29.244 version 16.5.0 Release 16) | ||
- 5G; System architecture for the 5G System (5GS) (3GPP TS 23.501 version 16.5.0 Release 16) | ||
|
||
The main goal is to enable in-kernel fast packet processing in third-party UPF/5G or SPGWu/LTE components in order to: | ||
1. Boost them for those which does not have any fast packet processing enabled, or | ||
1. Co-locate them with other fast packet processing solutions (e.g. DPDK) | ||
|
||
## Design | ||
|
||
The library is divided in two paths: | ||
- Slow path: An user space layer responsible to receive requests from the third-party UPF/SPGWu components to manage PFCP sessions and eBPF programs lifecycle | ||
- Fast path: A kernel space layer representing by eBPF/XDP programs responsible to handle the user traffic | ||
|
||
The high level design is shown in figure below. | ||
|
||
<img src="img/up-ebpf-xdp-high-level.svg" alt="drawing" width="500"/> | ||
|
||
The library has a component, called `PFCP Sesssion Manager`, which is a C++ API to responsible to manage PFCP (Packet Forwarding Control Protocol) sessions. For each session, there is an eBPF program that represents the PFCP context in the fast path. These programs are managed by `eBPF Program Manager` component. The fast path is composed by three main function: parser, traffic classifier and traffic forwarder. The image below shows this in more detail. | ||
|
||
<img src="img/up-ebpf-xdp-high-level2.svg" alt="drawing" width="600"/> | ||
|
||
## Features | ||
|
||
As described in 3GPP TS 29.244, the Information Elements (IEs) are part of the PFCP context. The context is created by sending PFCP Session Establishment Request message. The main IEs supported are: | ||
- PDR (Packet Detection Rule) | ||
- FAR (Forwarding Action Rule) | ||
|
||
The logical data model between PFCP Session and IEs is shown in the image below. For more detail, see 3GPP TS 29.244 version 16.5.0 Release 16. | ||
|
||
<img src="img/up-ebpf-xdp-ies.svg" alt="drawing" width="600"/> | ||
|
||
## Usage | ||
### Build Docker Image | ||
|
||
Copy the keys to jump server and run `make docker-build` | ||
### Testing | ||
|
||
 | ||
|
||
- Open terminal in `Linux #0` | ||
- Configure veth pairs with `make config-veth-pair` in `Linux #0` | ||
- Install the spdlog library with `make setup` | ||
- Build, load and run program with `make run` in `Linux #0` | ||
- Login remote Scapy `ssh -X [email protected] "cd /work/mestrado/scapy/; sudo -S ./run_scapy"` | ||
- Generate GTP G-PDU using [Scapy](https://github.com/secdev/scapy) with `gtpu-traffic-generator.py` in `Linux #1` | ||
- Open other terminal tab in `Linux #0` | ||
- Check logs: `sudo cat /sys/kernel/debug/tracing/trace | grep "GPDU"` in `Linux #0` | ||
|
||
### Make Commands | ||
|
||
``` | ||
- all Build all | ||
- clean Clean all build files | ||
- all-verbose Build all in verbose mode | ||
- config-veth-pair Config veth pair. It must be run before `run-*` targets | ||
- run-hello-world-samples Build all and run BPF XDP hello world sample | ||
- run-redirect-map-sample Build all and run BPF XDP redirect sample | ||
- run Build all and run BPF XDP UPF | ||
- run-scapy Run scapy for packet manipulation | ||
- force-xdp-deload Force deload XDP programs | ||
``` | ||
|
||
## Dependencies | ||
## Main Dependencies | ||
|
||
Upee | ||
Core | ||
- libbpf | ||
- libelf | ||
- libz | ||
- bpftool | ||
- spdlog | ||
- clang >= version 3.4.0 | ||
- llvm >= version 3.7.1 | ||
- kernel-headers => version 5.3 | ||
- bpftool | ||
|
||
Test | ||
- scapy v2.4.3 | ||
- spdlog | ||
- gtest | ||
- sysstat | ||
- trex v2.86 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Testing | ||
|
||
 | ||
|
||
- Open terminal in `Linux #0` | ||
- Configure veth pairs with `make config-veth-pair` in `Linux #0` | ||
- Install the spdlog library with `make setup` | ||
- Build, load and run program with `make run` in `Linux #0` | ||
- Login remote Scapy `ssh -X [email protected] "cd /work/mestrado/scapy/; sudo -S ./run_scapy"` | ||
- Generate GTP G-PDU using [Scapy](https://github.com/secdev/scapy) with `gtpu-traffic-generator.py` in `Linux #1` | ||
- Open other terminal tab in `Linux #0` | ||
- Check logs: `sudo cat /sys/kernel/debug/tracing/trace | grep "GPDU"` in `Linux #0` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters