Skip to content

Add an eBPF GTP-U backend - #223

Merged
linouxis9 merged 1 commit into
pr/core-aio5gc-startupfrom
pr/final-core-ebpf-gtpu
Oct 5, 2026
Merged

linouxis9 merged 1 commit into
pr/core-aio5gc-startupfrom
pr/final-core-ebpf-gtpu

Conversation

@linouxis9

@linouxis9 linouxis9 commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

New ebpf tunnel backend: eBPF programs on the UE's TUN device and on the interface towards the UPF encapsulate and decapsulate the packets in the kernel, with no kernel module. The userspace backend still does session setup, handover and release, and handles what the programs skip (Echo Requests, Router Advertisements, fragments, packets that are not the UE's).

auto now tries ebpf, then gtp5g, then userspace. It needs Linux 6.6. A UPF on the same host, on loopback or not, works too.

CI rebuilds the eBPF object with make ebpf and fails if it differs from the committed one, and runs the root tunnel tests on an arm64 runner as well: the same object serves both architectures.

Fix #23.

@linouxis9
linouxis9 force-pushed the pr/final-core-ebpf-gtpu branch from b11dc57 to d838cbf Compare October 4, 2026 17:04
@linouxis9 linouxis9 changed the title Add PacketRusher's own eBPF GTP-U backend Add an eBPF GTP-U backend Oct 4, 2026
@linouxis9
linouxis9 force-pushed the pr/final-core-ebpf-gtpu branch from d838cbf to d98dd82 Compare October 4, 2026 17:16
@linouxis9
linouxis9 force-pushed the pr/final-core-ebpf-gtpu branch from d98dd82 to 4bbdef1 Compare October 4, 2026 17:25
@linouxis9
linouxis9 added this pull request to stack #227 October 4, 2026 17:25

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cppcheck (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Short-cut the userspace backend in the kernel: eBPF programs on the UE's TUN device and on the N3 interface encapsulate and decapsulate its packets, so they no longer cross into userspace. Whatever the programs leave alone (Echo Requests, Router Advertisements, fragments, unknown tunnels) still reaches the userspace backend, which also keeps doing the session setup, handover and release.

The UE's packets cross a veth pair before their encapsulation, so that the kernel splits large TCP segments and completes their checksums.

--tunnel-backend ebpf selects it, and auto now prefers it: ebpf, then gtp5g, then userspace. It needs Linux 6.6 (TCX) and an N3 interface other than loopback.

Signed-off-by: Valentin <[email protected]>
@linouxis9
linouxis9 force-pushed the pr/final-core-ebpf-gtpu branch from 711a81b to 8cdb8ce Compare October 5, 2026 00:32
@linouxis9
linouxis9 merged commit cea3996 into main Oct 5, 2026
14 checks passed
@linouxis9
linouxis9 deleted the pr/final-core-ebpf-gtpu branch October 13, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace free5gc module with eBPF's code

2 participants