Chapter 6: PCG UPF Architecture — PEP, Data-Plane, Valkey

The Big Picture

┌─────────────────────────────────────────────┐ │ PCG Pod (Kubernetes) │ SMF ──PFCP──► │ │ │ ┌────────────────────────────────────────┐ │ │ │ pfcp-endpoint (PEP) │ │ │ │ │ │ │ │ • Receives PFCP messages from SMF │ │ │ │ • Parses PFCP, runs state machine │ │ │ │ • Stores session blob in Valkey │ │ │ │ • Forwards rules to data-plane │ │ │ │ • Handles retransmissions │ │ │ └──────────────┬─────────────────────────┘ │ │ │ internal (mbox/ITC) │ │ ▼ │ │ ┌────────────────────────────────────────┐ │ │ │ data-plane (DP) │ │ │ │ │ │ │ │ • Installs forwarding rules (PDRs) │ │ │ │ • Manages TEIDs, UEIP, L2TP keys │ │ │ │ • Stores per-bearer state in Valkey │ │ │ │ • Handles user-plane traffic (GTP-U) │ │ │ │ • CGNAT, DPI, firewall, etc. │ │ │ └──────────────┬─────────────────────────┘ │ │ │ │ │ ▼ │ │ ┌────────────────────────────────────────┐ │ │ │ Valkey Cluster (Redis-compatible) │ │ │ │ 6 nodes: 3 masters + 3 replicas │ │ │ │ │ │ │ │ Stores: sessions, TEIDs, UEIP, │ │ │ │ CGNAT maps, retransmissions │ │ │ └────────────────────────────────────────┘ │ └─────────────────────────────────────────────┘

Why Two Separate Processes?

The PFCP Session Lifecycle

// 1. SMF sends PFCP Session Establishment Request
// 2. PEP receives it, parses, creates session context
// 3. PEP stores session blob in Valkey (one key)
// 4. PEP sends rules to DP via mbox
// 5. DP installs rules, stores TEIDs/UEIP/etc in Valkey (multiple keys)
// 6. DP signals completion back to PEP
// 7. PEP sends PFCP Session Establishment Response to SMF

// The DB writes in step 5 are what PCPB-25616 optimizes!

DB Access Patterns

ComponentDB LibraryPatternFeature Change
PEP session storedb-proxy → db-muxOne blob per session (single SET/GET)Migrate to db-mux (CPU savings)
PEP retransmissiondb-proxy → db-muxLookup on each requestMigrate to db-mux
DP session rulesdb-proxy → db-muxMultiple keys per session (TEID, UEIP, etc.)Migrate + MSET batching
DP CGNATdb-proxyAlready batches internallyNo change planned

Shared Library: up-common

up-common is the shared library used by both PEP and DP. It contains:

Key Takeaways