How hewlettpackard/packetrusher works
Project type and purpose
• PacketRusher is a standalone, command-line performance-testing and validation tool for 5G Core Networks.
• It simulates both UE (user equipment) and gNodeB (5G base station) at scale (up to 10k UEs), exercising N1 (NAS), N2 (NGAP), and N3 (GTP-U) interfaces.
• It embeds a mock 5GC/AMF for integration testing and leverages C/C++ GTP-U kernel modules via cgo.
File structure
• cmd/packetrusher.go: CLI entry point.
• config/: configuration definitions (YAML + loader).
• internal/: core Go modules segmented by concern:
• common: shared auth, SUCI concealing/deconcealing, tools
• control_test_engine: orchestrator and simulators for gNB and UE (context, NAS, NGAP dispatchers, scenarios, triggers)
• work_load_model: traffic models (Poisson, Gaussian, Exponential)
• analytics & monitoring: metrics collection and reporting
• script & templates: scenario codegen and test-case scaffolding
• lib/: third-party or in-tree C libraries exposed via cgo:
• gtp5g: kernel module wrapper for high-speed GTP-U tunnels
• ngap: SCTP/NGAP message encoding/decoding
• util_3gpp: 3GPP data types and helpers
• docker/, dev/, scenarios/, test/: environment setups, sample scenarios, and automated tests.
README for additional insights
• Confirms simulation of multi-UE/gNB, stress testing on N1/N2/N3, SUCI schemes, handovers, PDU sessions, roaming.
• Describes reliance on a custom gtp5g kernel module and pure-Go NGAP/NAS stacks borrowed from free5gc.
Final checklist
• Internal packages as sub-components of their parent modules.
• External dependencies (free5gc libraries, kernel modules, real 5GC).
• Data-flow directions and annotate interface types.