### Install Golang Source: https://github.com/hewlettpackard/packetrusher/blob/main/docs/RHEL9Install.md Downloads and installs Golang 1.21.3. This command will remove any existing local Go installation. After installation, the Go binary is added to the PATH. ```bash # Install Golang # Warning this command will remove your existing local Go installation if you have one: $ wget https://go.dev/dl/go1.21.3.linux-amd64.tar.gz && sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.21.3.linux-amd64.tar.gz # Add go binary to the executable PATH variable: $ echo 'export PATH=$PATH:/usr/local/go/bin' >> $HOME/.profile ``` -------------------------------- ### Install Go Toolchain Source: https://github.com/hewlettpackard/packetrusher/wiki/Installation Downloads and installs a recent version of the Go toolchain. This command will overwrite any existing local Go installation. ```bash # Warning this command will remove your existing local Go installation if you have one $ wget https://go.dev/dl/go1.24.1.linux-amd64.tar.gz && sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.24.1.linux-amd64.tar.gz ``` -------------------------------- ### Install Dependencies for PacketRusher Source: https://github.com/hewlettpackard/packetrusher/blob/main/README.md Installs necessary build tools, kernel headers, and Go. Warning: the Go installation command will remove existing local Go installations. ```bash sudo apt install build-essential linux-headers-generic make git wget tar linux-modules-extra-$(uname -r) # Warning this command will remove your existing local Go installation if you have one: wget https://go.dev/dl/go1.24.1.linux-amd64.tar.gz && sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.24.1.linux-amd64.tar.gz # Add go binary to the executable PATH variable: echo 'export PATH=$PATH:/usr/local/go/bin' >> $HOME/.profile ``` -------------------------------- ### Install System Dependencies and Build Source: https://context7.com/hewlettpackard/packetrusher/llms.txt Commands to install required build tools, Go, and compile the PacketRusher CLI and kernel modules on Ubuntu. ```bash # Ubuntu 20.04-24.04 with kernel >= 5.4 # Requires root privileges and secure boot disabled # Install build dependencies sudo apt install build-essential linux-headers-generic make git wget tar linux-modules-extra-$(uname -r) # Install Go 1.23+ (removes existing installation) wget https://go.dev/dl/go1.24.1.linux-amd64.tar.gz sudo rm -rf /usr/local/go sudo tar -C /usr/local -xzf go1.24.1.linux-amd64.tar.gz echo 'export PATH=$PATH:/usr/local/go/bin' >> $HOME/.profile source $HOME/.profile # Clone PacketRusher git clone https://github.com/HewlettPackard/PacketRusher cd PacketRusher echo "export PACKETRUSHER=$PWD" >> $HOME/.profile source $HOME/.profile # Build gtp5g kernel module (required for GTP-U) cd $PACKETRUSHER/lib/gtp5g make clean && make -j && sudo make install # Build PacketRusher CLI cd $PACKETRUSHER go mod download go build cmd/packetrusher.go # Verify installation ./packetrusher --help ``` -------------------------------- ### PacketRusher YAML Configuration Example Source: https://github.com/hewlettpackard/packetrusher/wiki/Configuration Example configuration file structure for setting up gNodeB, UE, and AMF parameters. ```yaml amf: ip: 192.168.11.30 port: 38412 gnb: controlif: ip: 192.168.11.13 port: 38412 dataif: ip: 192.168.11.13 port: 2152 plmnlist: - mcc: 999 mnc: 70 tac: 1 gnbid: 1 slicesupportlist: - sst: 1 sd: 000001 ues: - msin: 0000000120 key: 00112233445566778899AABBCCDDEEFF opc: 00112233445566778899AABBCCDDEEFF amf: 8000 sqn: 00000000 dnn: internet hplmn: mcc: 999 mnc: 70 snssai: sst: 1 sd: 000001 ``` -------------------------------- ### Install Dependencies for PacketRusher Source: https://github.com/hewlettpackard/packetrusher/blob/main/docs/RHEL9Install.md Installs necessary packages including development tools, kernel headers, and SCTP utilities. If kernel module installation fails, ensure Secure Boot is disabled. ```bash # Install the required packages $ sudo yum install git wget tar make automake gcc gcc-c++ kernel-devel-$(uname -r) kernel-modules-extra-$(uname -r) lksctp-tools lksctp-tools-devel lksctp-tools-doc mokutil ``` -------------------------------- ### Install Linux Dependencies Source: https://github.com/hewlettpackard/packetrusher/wiki/Installation Installs essential build tools, kernel headers, and modules required for PacketRusher. Ensure your kernel version is compatible. ```bash $ sudo apt install build-essential linux-headers-generic make git wget tar linux-modules-extra-$(uname -r) ``` -------------------------------- ### Install gtp5g Kernel Module Source: https://github.com/hewlettpackard/packetrusher/blob/main/lib/gtp5g/README.md Install the compiled kernel module to the system. This command also ensures it loads automatically at boot. ```bash sudo make install ``` -------------------------------- ### Download and Setup PacketRusher Source: https://github.com/hewlettpackard/packetrusher/blob/main/README.md Clones the PacketRusher repository and sets the PACKETRUSHER environment variable. ```bash git clone https://github.com/HewlettPackard/PacketRusher # or download the ZIP from https://github.com/HewlettPackard/PacketRusher/archive/refs/heads/master.zip and upload it to your Linux server cd PacketRusher && echo "export PACKETRUSHER=$PWD" >> $HOME/.profile source $HOME/.profile ``` -------------------------------- ### Build free5gc's gtp5g Kernel Module Source: https://github.com/hewlettpackard/packetrusher/blob/main/README.md Compiles and installs the gtp5g kernel module. Ensure Secure Boot is disabled if installation fails. ```bash cd $PACKETRUSHER/lib/gtp5g make clean && make && sudo make install ``` -------------------------------- ### Launch Packetrusher Tester Source: https://github.com/hewlettpackard/packetrusher/blob/main/docker/README.md Starts the tester service using Docker Compose, assuming the core network is already configured. ```bash docker-compose -f docker/docker-compose.yaml up -d ``` -------------------------------- ### Install SCTP Kernel Module Source: https://github.com/hewlettpackard/packetrusher/blob/main/docs/RHEL9Install.md Configures and loads the SCTP kernel module. If you encounter issues, verify that Secure Boot is disabled by running 'mokutil --sb-state'. ```bash # Install sctp kernel module $ echo sctp | sudo tee /etc/modules-load.d/sctp.conf $ sudo sed -i 's/blacklist sctp/#blacklist sctp/g' /etc/modprobe.d/sctp-blacklist.conf $ sudo sed -i 's/blacklist sctp_diag/#blacklist sctp_diag/g' /etc/modprobe.d/sctp_diag-blacklist.conf $ sudo modprobe sctp # If you are unable to install the custom Kernel module, make sure you have Secure boot disabled by running "mokutil --sb-state". ``` -------------------------------- ### Build free5gc's gtp5g Kernel Module Source: https://github.com/hewlettpackard/packetrusher/wiki/Installation Compiles and installs the GTP-U user plane stack kernel module. Requires previously installed dependencies and disabled Secure Boot if issues arise. ```bash $ cd $PACKETRUSHER/lib/gtp5g $ make clean && make -j && sudo make install ``` -------------------------------- ### Build free5gc's gtp5g Kernel Module Source: https://github.com/hewlettpackard/packetrusher/blob/main/docs/RHEL9Install.md Compiles and installs the gtp5g kernel module from the PacketRusher source. If installation fails, check Secure Boot status. ```bash $ cd $PACKETRUSHER/lib/gtp5g $ make clean && make && sudo make install # If you are unable to install the custom Kernel module, make sure you have Secure boot disabled by running "mokutil --sb-state". ``` -------------------------------- ### PacketRusher YAML Configuration Source: https://context7.com/hewlettpackard/packetrusher/llms.txt Example YAML configuration file for PacketRusher, defining gNodeB identity, network interfaces, and supported network slices. ```yaml # PacketRusher Simulated gNodeB Configuration gnodeb: # N2 Interface (gNodeB <-> AMF) - SCTP for control plane controlif: ip: "192.168.11.13" port: 9487 # N3 Interface (gNodeB <-> UPF) - UDP for user plane dataif: ip: "192.168.11.13" port: 2152 # gNodeB Identity plmnlist: mcc: "999" mnc: "70" tac: "000001" gnbid: "000008" # Supported Network Slices slicesupportlist: sst: "01" sd: "000001" # optional ``` -------------------------------- ### Run Standalone gNodeB Source: https://context7.com/hewlettpackard/packetrusher/llms.txt Launches only a gNodeB without any UE. This mode is useful for testing NG Setup procedures with the AMF. ```bash # Launch standalone gNodeB sudo ./packetrusher gnb ``` -------------------------------- ### AMF Availability Monitoring Source: https://context7.com/hewlettpackard/packetrusher/llms.txt Monitors the availability of the AMF over a specified time interval by checking NG Setup responses. ```bash # Monitor AMF availability for 60 seconds sudo ./packetrusher amf-availability -t 60 ``` -------------------------------- ### AMF Load Testing Source: https://context7.com/hewlettpackard/packetrusher/llms.txt Tests the AMF's response capabilities by generating multiple NG Setup requests per second over a specified duration. ```bash # Generate 20 requests per second for 30 seconds sudo ./packetrusher amf-load-loop -n 20 -t 30 ``` ```bash # Generate 100 requests per second for 60 seconds sudo ./packetrusher amf-load-loop --number-of-requests 100 --time 60 ``` -------------------------------- ### Create gNodeB and UE Contexts in Go Source: https://context7.com/hewlettpackard/packetrusher/llms.txt Initializes a gNodeB and a UE, triggers registration, and requests a PDU session. Requires a valid configuration file at the specified path. ```go package main import ( "sync" "time" "my5G-RANTester/config" "my5G-RANTester/internal/control_test_engine/gnb" "my5G-RANTester/internal/control_test_engine/ue" "my5G-RANTester/internal/control_test_engine/procedures" ) func main() { wg := sync.WaitGroup{} // Load configuration cfg := config.Load("./config/config.yml") // Initialize gNodeB wg.Add(1) gnbContext := gnb.InitGnb(cfg, &wg) // Wait for NG Setup to complete time.Sleep(1 * time.Second) // Create UE communication channel ueChan := make(chan procedures.UeTesterMessage) // Initialize UE wg.Add(1) ueTx := ue.NewUE(cfg, 1, ueChan, gnbContext.GetInboundChannel(), &wg) // Trigger UE registration ueChan <- procedures.UeTesterMessage{Type: procedures.Registration} // Wait for registration to complete msg := <-ueTx if msg.StateChange == context.MM5G_REGISTERED { // Request PDU session ueChan <- procedures.UeTesterMessage{Type: procedures.NewPDUSession} } // Keep UE registered for 30 seconds time.Sleep(30 * time.Second) // Graceful shutdown ueChan <- procedures.UeTesterMessage{Type: procedures.Terminate} wg.Wait() } ``` -------------------------------- ### Building and Running Custom Scenarios Source: https://context7.com/hewlettpackard/packetrusher/llms.txt Instructions for building a custom scenario into a WebAssembly module using TinyGo and running it with PacketRusher. ```bash # Install TinyGo for WebAssembly compilation # See: https://tinygo.org/getting-started/install/ # Build scenario to WebAssembly cd scenarios/custom tinygo build -o custom.wasm -target wasi custom.go # Run the custom scenario sudo ./packetrusher custom-scenario --scenario scenarios/custom/custom.wasm ``` -------------------------------- ### Enable/Disable QoS Source: https://github.com/hewlettpackard/packetrusher/blob/main/lib/gtp5g/README.md Enable QoS by echoing 1 to /proc/gtp5g/qos, or disable it by echoing 0. ```bash echo 1 > /proc/gtp5g/qos ``` ```bash echo 0 > /proc/gtp5g/qos ``` -------------------------------- ### Run Custom WebAssembly Scenarios Source: https://context7.com/hewlettpackard/packetrusher/llms.txt Executes custom test scenarios written in WebAssembly. Requires building the scenario with TinyGo first. ```bash # Build custom scenario with TinyGo cd scenarios/sample tinygo build -o sample.wasm -target wasi sample.go ``` ```bash # Run custom scenario sudo ./packetrusher custom-scenario --scenario scenarios/sample/sample.wasm ``` -------------------------------- ### Define and Use UE Procedure Types Source: https://context7.com/hewlettpackard/packetrusher/llms.txt Lists available constants for controlling UE states and demonstrates how to send commands via the UE communication channel. ```go // Available UE procedure types for programmatic control const ( Registration // Trigger UE registration with network Deregistration // Trigger UE deregistration NewPDUSession // Create new PDU session DestroyPDUSession // Release PDU session (set Param to session ID) Idle // Switch UE to CM-IDLE mode ServiceRequest // Reconnect from CM-IDLE mode Terminate // Gracefully terminate UE Kill // Immediately stop UE ) // Example usage ueChan <- procedures.UeTesterMessage{Type: procedures.Registration} ueChan <- procedures.UeTesterMessage{Type: procedures.NewPDUSession} ueChan <- procedures.UeTesterMessage{Type: procedures.DestroyPDUSession, Param: 1} ueChan <- procedures.UeTesterMessage{Type: procedures.Idle} ueChan <- procedures.UeTesterMessage{Type: procedures.ServiceRequest} ueChan <- procedures.UeTesterMessage{Type: procedures.Terminate} ``` -------------------------------- ### Download and Set Up PacketRusher Source: https://github.com/hewlettpackard/packetrusher/wiki/Installation Clones the PacketRusher repository and sets the PACKETRUSHER environment variable. Ensure you are in the desired directory before cloning. ```bash $ git clone https://github.com/HewlettPackard/PacketRusher # or download the ZIP from https://github.com/HewlettPackard/PacketRusher/archive/refs/heads/master.zip and upload it to your Linux server $ cd PacketRusher && echo "export PACKETRUSHER=$PWD" >> $HOME/.profile && source $HOME/.profile ``` -------------------------------- ### Build PacketRusher CLI Source: https://github.com/hewlettpackard/packetrusher/wiki/Installation Downloads Go dependencies and builds the PacketRusher command-line interface executable. After building, you can run `./packetrusher --help`. ```bash $ cd $PACKETRUSHER $ go mod download $ go build cmd/packetrusher.go $ ./packetrusher --help ``` -------------------------------- ### Perform Multi-gNodeB Handover Testing Source: https://context7.com/hewlettpackard/packetrusher/llms.txt Simulates two gNodeBs and triggers a handover for a UE. Requires sequential N2/N3 IP addresses in the configuration. ```go package main import ( "sync" "time" "my5G-RANTester/config" "my5G-RANTester/internal/common/tools" "my5G-RANTester/internal/control_test_engine/gnb/ngap/trigger" "my5G-RANTester/internal/control_test_engine/procedures" ) func main() { wg := sync.WaitGroup{} cfg := config.Load("./config/config.yml") // Create 2 gNodeBs for handover testing // Requires 2 sequential N2/N3 IP addresses gnbs := tools.CreateGnbs(2, cfg, &wg) time.Sleep(1 * time.Second) // Configure UE simulation ueSimCfg := tools.UESimulationConfig{ UeId: 1, Gnbs: gnbs, Cfg: cfg, ScenarioChan: make(chan procedures.UeTesterMessage), TimeBeforeDeregistration: 0, TimeBeforeNgapHandover: 0, TimeBeforeXnHandover: 0, TimeBeforeIdle: 0, TimeBeforeReconnecting: 1000, NumPduSessions: 1, RegistrationLoop: false, } // Start UE simulation tools.SimulateSingleUE(ueSimCfg, &wg) // Wait for registration time.Sleep(5 * time.Second) // Get gNodeB contexts by ID gnbIds := make([]string, 0, len(gnbs)) for id := range gnbs { gnbIds = append(gnbIds, id) } // Trigger Xn handover from gnb[0] to gnb[1] trigger.TriggerXnHandover(gnbs[gnbIds[0]], gnbs[gnbIds[1]], 1) // Or trigger NGAP handover // trigger.TriggerNgapHandover(gnbs[gnbIds[0]], gnbs[gnbIds[1]], 1) time.Sleep(30 * time.Second) wg.Wait() } ``` -------------------------------- ### Add Go Binary to PATH Source: https://github.com/hewlettpackard/packetrusher/wiki/Installation Appends the Go binary directory to your system's executable PATH. Changes to profile files require a re-login or sourcing the file to take effect immediately. ```bash export PATH=$PATH:/usr/local/go/bin ``` ```bash $ source $HOME/.profile ``` -------------------------------- ### Build PacketRusher CLI Source: https://github.com/hewlettpackard/packetrusher/blob/main/README.md Downloads Go dependencies and builds the PacketRusher command-line interface executable. ```bash cd $PACKETRUSHER go mod download go build cmd/packetrusher.go ./packetrusher --help ``` -------------------------------- ### Run Basic PacketRusher Scenario Source: https://github.com/hewlettpackard/packetrusher/wiki/Installation Executes a basic PacketRusher scenario for a single User Equipment (UE). Ensure you are in the PacketRusher directory. ```bash sudo ./packetrusher ue ``` -------------------------------- ### Compile gtp5g Module Source: https://github.com/hewlettpackard/packetrusher/blob/main/lib/gtp5g/README.md Navigate to the gtp5g directory and run make clean and make to compile the kernel module. ```bash cd gtp5g make clean && make ``` -------------------------------- ### Run Multi-UE PacketRusher Scenario Source: https://github.com/hewlettpackard/packetrusher/wiki/Installation Executes a more complex scenario involving multiple User Equipments (UEs). Use `./packetrusher multi-ue --help` for detailed options. ```bash sudo ./packetrusher multi-ue ``` -------------------------------- ### Multi-UE Configuration with Sequential MSINs Source: https://context7.com/hewlettpackard/packetrusher/llms.txt Provisions multiple UEs with sequential MSINs when using the --multi-ue flag. All UEs share the same credentials. ```yaml # Example: 5 UEs with MSIN 0000000120 to 0000000124 # All UEs share the same credentials but have sequential MSINs # UE0: imsi-999700000000120 # UE1: imsi-999700000000121 # UE2: imsi-999700000000122 # UE3: imsi-999700000000123 # UE4: imsi-999700000000124 ue: msin: "0000000120" # Base MSIN key: "00112233445566778899AABBCCDDEEFF" opc: "00112233445566778899AABBCCDDEEFF" ``` -------------------------------- ### Build and Run Single UE Test Source: https://context7.com/hewlettpackard/packetrusher/llms.txt Builds the PacketRusher tool and runs a single UE registration test. Requires root privileges for GTP-U tunnel operations. Use --disableTunnel to run without it or --pcap for packet capture. ```bash # Build PacketRusher go build cmd/packetrusher.go ``` ```bash # Run single UE test (requires root for GTP-U tunnel) sudo ./packetrusher ue ``` ```bash # Run single UE test without GTP-U tunnel interface sudo ./packetrusher ue --disableTunnel ``` ```bash # Run with PCAP capture for debugging sudo ./packetrusher ue --pcap ./capture.pcap ``` ```bash # Use custom configuration file sudo ./packetrusher --config /path/to/config.yml ue ``` -------------------------------- ### Run Custom Scenario CLI Source: https://github.com/hewlettpackard/packetrusher/blob/main/scenarios/README.md Execute a custom WebAssembly scenario using the PacketRusher CLI. Ensure the scenario is built into a .wasm file. ```bash ./app custom-scenario --scenario sample.go.wasm ``` -------------------------------- ### Check QoS Status Source: https://github.com/hewlettpackard/packetrusher/blob/main/lib/gtp5g/README.md Check if QoS is enabled (1) or disabled (0) by reading the /proc/gtp5g/qos file. ```bash cat /proc/gtp5g/qos ``` -------------------------------- ### Multi-UE Load Testing Source: https://context7.com/hewlettpackard/packetrusher/llms.txt Performs stress testing by registering multiple UEs concurrently. Options include configuring registration intervals, PDU sessions per UE, automatic deregistration, and loop modes. ```bash # Register 100 UEs with 500ms interval between registrations sudo ./packetrusher multi-ue -n 100 --timeBetweenRegistration 500 ``` ```bash # Register 50 UEs with automatic deregistration after 10 seconds sudo ./packetrusher multi-ue -n 50 --timeBeforeDeregistration 10000 ``` ```bash # Multi-UE with 3 PDU sessions per UE sudo ./packetrusher multi-ue -n 20 --numPduSessions 3 ``` ```bash # Multi-UE with GTP-U tunnel enabled (requires dedicatedGnb) sudo ./packetrusher multi-ue -n 5 --tunnel --dedicatedGnb --timeBetweenRegistration 500 ``` ```bash # Loop registration/deregistration continuously sudo ./packetrusher multi-ue -n 10 --loop --timeBeforeDeregistration 5000 --timeBeforeReregistration 1000 ``` ```bash # Loop with specific count sudo ./packetrusher multi-ue -n 10 --loop --loopCount 5 ``` ```bash # Test CM-IDLE mode transitions sudo ./packetrusher multi-ue -n 5 --timeBeforeIdle 3000 --timeBeforeReconnecting 2000 ``` ```bash # Test Xn handover between gNodeBs sudo ./packetrusher multi-ue -n 5 --timeBeforeXnHandover 5000 --dedicatedGnb ``` ```bash # Test NGAP handover between gNodeBs sudo ./packetrusher multi-ue -n 5 --timeBeforeNgapHandover 5000 --dedicatedGnb ``` -------------------------------- ### Build Docker Image Source: https://context7.com/hewlettpackard/packetrusher/llms.txt Builds the PacketRusher Docker image using the provided Dockerfile. ```bash # Build Docker image docker build -f docker/Dockerfile --target packetrusher --tag packetrusher:latest . ``` -------------------------------- ### Check gtp5g Rules (PDR/FAR/QER) Source: https://github.com/hewlettpackard/packetrusher/blob/main/lib/gtp5g/README.md Query PDR, FAR, or QER information by writing to the respective /proc/gtp5g files. If UPF uses a legacy netlink struct without SEID, use SEID=0. ```bash # if UPF used legacy netlink struct without SEID, need use #SEID=0 to query related info as below: echo #interfaceName #SEID #PDRID > /proc/gtp5g/pdr echo #interfaceName #SEID #FARID > /proc/gtp5g/far echo #interfaceName #SEID #QERID > /proc/gtp5g/qer ``` ```bash cat /proc/gtp5g/pdr cat /proc/gtp5g/far cat /proc/gtp5g/qer ``` -------------------------------- ### Download PacketRusher Source Code Source: https://github.com/hewlettpackard/packetrusher/blob/main/docs/RHEL9Install.md Clones the PacketRusher repository from GitHub and sets the PACKETRUSHER environment variable. Ensure you source the profile to apply changes. ```bash $ git clone https://github.com/HewlettPackard/PacketRusher # or download the ZIP from https://github.com/Hewlett Packard/PacketRusher/archive/refs/heads/master.zip and upload it to your Linux server $ cd PacketRusher && echo "export PACKETRUSHER=$PWD" >> $HOME/.profile $ source $HOME/.profile ``` -------------------------------- ### Simulated UE Configuration Source: https://context7.com/hewlettpackard/packetrusher/llms.txt Defines the identity, SUCI configuration, SIM credentials, PDU session, and security capabilities for a simulated UE. ```yaml ue: # UE Identity (SUPI will be imsi-999700000000120) hplmn: mcc: "999" mnc: "70" msin: "0000000120" # SUCI Configuration routingindicator: "0000" # Protection Scheme: 0=Null, 1=Profile A (X25519), 2=Profile B (P-256) protectionScheme: 0 # Home Network Public Key (required for Profile A/B) homeNetworkPublicKey: "5a8d38864820197c3394b92613b20b91633cbd897119273bf8e4a6f4eec0a650" homeNetworkPublicKeyID: 1 # SIM Credentials key: "00112233445566778899AABBCCDDEEFF" opc: "00112233445566778899AABBCCDDEEFF" amf: "8000" sqn: "00000000" # PDU Session Configuration dnn: "internet" snssai: sst: "01" sd: "000001" # UE Security Capabilities integrity: nia0: false nia1: false nia2: true nia3: false ciphering: nea0: true # Cleartext for Wireshark debugging nea1: false nea2: true nea3: false # AMF Connection Configuration amfif: - ip: "192.168.11.30" port: 38412 # Logging Configuration (1=Fatal, 2=Error, 3=Warn, 4=Info, 5=Debug, 6=Trace) logs: level: 4 ``` -------------------------------- ### Build Packetrusher Docker Image Source: https://github.com/hewlettpackard/packetrusher/blob/main/docker/README.md Builds the Docker image using the specified Dockerfile and target. ```bash docker build -f docker/Dockerfile --target packetrusher --tag packetrusher:latest . ``` -------------------------------- ### Clone Latest gtp5g Version Source: https://github.com/hewlettpackard/packetrusher/blob/main/lib/gtp5g/README.md Use this command to clone the latest version of the gtp5g repository from GitHub. ```bash git clone https://github.com/free5gc/gtp5g.git ``` -------------------------------- ### Check System Logs Source: https://github.com/hewlettpackard/packetrusher/blob/main/lib/gtp5g/README.md View system logs, which may contain messages from the gtp5g module. ```bash dmesg ``` -------------------------------- ### Custom Scenario Go API Functions Source: https://context7.com/hewlettpackard/packetrusher/llms.txt Defines exported functions for controlling UE behavior within custom WebAssembly scenarios. These functions are called by PacketRusher. ```go // scenarios/custom/custom.go package main import "fmt" // Import PacketRusher host functions //export attach func attach(ueId uint32) //export detach func detach(ueId uint32) //export pduSessionRequest func pduSessionRequest(ueId uint32, pduSessionId uint32) //export pduSessionRelease func pduSessionRelease(ueId uint32, pduSessionId uint32) //export think func think(milliseconds uint32) // Main UE handler - called by PacketRusher //export ueHandler func ueHandler(ueId uint32) { fmt.Println("Starting UE scenario for UE:", ueId) // Step 1: Register UE with network attach(ueId) think(2000) // Wait 2 seconds // Step 2: Create multiple PDU sessions for pduId := uint32(1); pduId <= 3; pduId++ { fmt.Printf("Creating PDU Session %d\n", pduId) pduSessionRequest(ueId, pduId) think(1000) } // Step 3: Simulate data session think(10000) // Active for 10 seconds // Step 4: Release PDU sessions for pduId := uint32(1); pduId <= 3; pduId++ { fmt.Printf("Releasing PDU Session %d\n", pduId) pduSessionRelease(ueId, pduId) think(500) } // Step 5: Deregister from network detach(ueId) fmt.Println("UE scenario completed") } func main() {} ``` -------------------------------- ### Sign Commits with Developer's Certificate of Origin Source: https://github.com/hewlettpackard/packetrusher/blob/main/README.md Adds a 'Signed-off-by' line to commit messages to accept the DCO. Use 'git commit -s' to automate this. ```bash Signed-off-by: Jane Example ``` -------------------------------- ### Configure Yum Repositories for RHEL9 Source: https://github.com/hewlettpackard/packetrusher/blob/main/docs/RHEL9Install.md Modifies yum repository configurations to point to archived RHEL9.0 sources. Ensure you have disabled Secure Boot if you encounter issues with kernel modules. ```bash # Change yum repo to the archived 9.0 one $ sudo find /etc/yum.repos.d -type f -exec sed -i -e "s,#baseurl=http://dl.rockylinux.org/\$contentdir/\$releasever,baseurl=https://download.rockylinux.org/vault/rocky/9.0,g" {} \; $ sudo find /etc/yum.repos.d -type f -exec sed -i -e "s,mirrorlist,#mirrorlist,g" {} \; $ sudo find /etc/yum.repos.d -type f -exec sed -i -e "s,/os/,/kickstart/,g" {} \; ``` -------------------------------- ### Enable/Disable GTP-U Sequence Number Source: https://github.com/hewlettpackard/packetrusher/blob/main/lib/gtp5g/README.md Enable GTP-U Sequence Number by echoing 1 to /proc/gtp5g/seq, or disable it by echoing 0. ```bash echo 1 > /proc/gtp5g/seq ``` ```bash echo 0 > /proc/gtp5g/seq ``` -------------------------------- ### Update gtp5g Log Level Source: https://github.com/hewlettpackard/packetrusher/blob/main/lib/gtp5g/README.md Update the gtp5g module's log level by echoing a number between 0 and 4 to /proc/gtp5g/dbg. ```bash # [number] is 0~4 # e.g. echo 4 > /proc/gtp5g/dbg echo [number] > /proc/gtp5g/dbg ``` -------------------------------- ### Clone Specific gtp5g Version Source: https://github.com/hewlettpackard/packetrusher/blob/main/lib/gtp5g/README.md Clone a specific version of the gtp5g repository by specifying the branch or tag. ```bash # git clone -b {version} https://github.com/free5gc/gtp5g.git git clone -b v0.8.10 https://github.com/free5gc/gtp5g.git ``` -------------------------------- ### SUCI Protection Scheme Configuration Source: https://context7.com/hewlettpackard/packetrusher/llms.txt Configures SUCI concealment for privacy using different encryption profiles: Null, Profile A (X25519), and Profile B (P-256). ```yaml # Null Scheme (no encryption) - Default ue: protectionScheme: 0 # homeNetworkPublicKey is ignored ``` ```yaml # Profile A (X25519 curve) ue: protectionScheme: 1 homeNetworkPublicKey: "5a8d38864820197c3394b92613b20b91633cbd897119273bf8e4a6f4eec0a650" homeNetworkPublicKeyID: 1 ``` ```yaml # Profile B (P-256 curve) ue: protectionScheme: 2 homeNetworkPublicKey: "0272DA71976234CE833A6907425867B82E074D44EF907DFB4B3E21C1C2256EBCD1" homeNetworkPublicKeyID: 2 ``` -------------------------------- ### Check GTP-U Sequence Number Status Source: https://github.com/hewlettpackard/packetrusher/blob/main/lib/gtp5g/README.md Check if GTP-U Sequence Number is enabled (1) or disabled (0) by reading the /proc/gtp5g/seq file. ```bash cat /proc/gtp5g/seq ``` -------------------------------- ### Remove gtp5g Kernel Module Source: https://github.com/hewlettpackard/packetrusher/blob/main/lib/gtp5g/README.md Use this command to remove the gtp5g kernel module from the system. ```bash sudo make uninstall ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.