Skip to content

Test a UPF

You can test a UPF on its own, with no AMF, SMF or rest of the core. rk plays both network functions a UPF talks to:

text

The gNB sits on a gtpu transport instead of an ngap one. That gives it an N3 endpoint and nothing else: no SCTP, no NG Setup.

This needs the licence features proto.pfcp and proto.gtpu.

The environment

YAML

The flow

On N2, a gNB learns its tunnel from the core. Here there's no N2, so the flow does it:

  • establish the PFCP session;
  • read the F-TEID and the UE address the UPF allocated;
  • start traffic with uplane_start, passing remote_teid, remote_addr and ue_ip (see User plane).

d3x-templates has this flow: upf_dut_session_and_traffic.

Shell

The check that proves forwarding is the received count. rk counts a packet only when a G-PDU comes back to the gNB's own downlink TEID on its N3 socket. A non-zero count therefore means the UPF forwarded both ways, on the tunnel the two sides agreed over N4.

Answer the traffic on N6

To control the data-network side too, run rk server dn as the destination behind the UPF's N6.

The opposite direction: rk as the UPF

A upf NF on a gtpu transport with a reflector: block makes rk answer GTP-U itself, so you can test the gNB side or the SMF side. The reflector:

  • echoes uplink traffic back as downlink;
  • handles unknown TEIDs with unknown_teid: error_indication (the default), drop or mirror;
  • rate-limits the Error Indications and Echo Responses it sends.

rk server uspace and rk server dpdk

To answer plain traffic, or to stand in for the UPF on DPDK, run a server on its own:

Shell
  • server dpdk needs the licence feature datapath.dpdk and the full build. It ends with a verdict: it passes when something was reflected and nothing was dropped.
  • -metrics-port serves Prometheus metrics on both, with the licence feature obs.prometheus. See Metrics.
  • Exit codes: 2 for a missing or bad -protocol, 5 when the licence refuses, 4 when a port can't be bound. See Exit codes.