Choose a UPF datapath
Pick the right UPF packet forwarder — stub for control-plane tests, userspace for real forwarding on a laptop, or DPDK for throughput.
The UPF ships three interchangeable datapaths. They all speak the same N4/PFCP control plane to the SMF, so the DMF and the rest of the core do not change when you switch — only what happens to user packets does. Select one with -datapath:
stub — control-plane testing (default)
The default. The stub installs PFCP sessions and tracks PDRs/FARs but never touches the kernel or forwards real packets. It needs no privileges and no NIC, which makes it ideal for control-plane tests and walking through a registration or PDU-session flow without a data network.
userspace — real forwarding on a laptop
The userspace datapath opens a TUN interface on N6 and a UDP socket for GTP-U on N3, then forwards UE traffic in Go. It needs CAP_NET_ADMIN (run as root, or grant the capability to the binary), but no special hardware — so it is the right choice for a working lab on a single machine.
The kernel-side IP and route on the TUN, plus any N6 NAT, are yours to configure. To do the NAT44 in-process instead of with iptables, pass a public source address with -nat44-addr:
-nat44-addr, -tun-name, and -n3-addr only apply to
the userspace datapath. With the stub, -nat44-addr is ignored with a warning.dpdk — throughput
The DPDK datapath drives a NIC fast path for high packet rates. It is a build-tagged option (-tags dpdk) and requires libdpdk, hugepages, and a vfio-pci-bound NIC — so it targets benchmarking and throughput work, not a casual laptop setup. It exposes a family of -dpdk-* flags to choose ethdev ports, pin worker lcores, and wrap L2/L3 headers for real-NIC rx/tx.
-tags dpdk plus host setup (hugepages,
vfio-pci). Without that, use userspace for real forwarding.Which one should I use?
- stub — control-plane testing and signalling demos. No privileges, no NIC.
- userspace — a real working datapath on one machine. Needs
CAP_NET_ADMIN. - dpdk — throughput and benchmarking. Needs a DPDK build and host setup.
Where to go next
Walk through bringing up a real datapath in the user-plane tutorial, read how the user plane works, or see every flag in the d3x-core-upf CLI reference.