> For the complete documentation index, see [llms.txt](https://docs.cennso.com/test-tools/tpload/latest/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/test-tools/tpload/latest/use-cases/testing-upg.md).

# Test UPG

Benchmark testing for User Plane Gateway (UPG) is one of the simplest TPLoad test cases. In this use case, TPLoad Core simulates the PFCP endpoint for UPG and the TPLoad Generator-left and TPLoad Generator-right are directly attached to the UPG access interface and to the DN interface. For the purpose of this test, UPG is tested in the Traffic Detection Function (TDF) mode without any traffic encapsulation.

![tpload and generators scheme](https://docs.cennso.com/api/assets/test-tools/tpload/latest/assets/test-upg.svg "Test UPG scenario")

For this use case, UPG has the following configuration:

| Component | Interface | Address |
|:---|:---|:---|
| UPG | Access | 198.18.0.1 |
| UPG | Sx | 172.20.0.1 |
| UPG | DN | 198.19.0.1 |

TPLoad has the following addresses:

| Component | Interface | Address | Gateway |
|:---|:---|:---|:---|
| TPLoad Core | Sx | 172.20.0.128 | - |
| TPLoad Generator-left | Access | 198.18.0.129+ | 198.18.0.1 |
| TPLoad Generator-right | DN | 198.19.0.129+ | 198.19.0.1 |

## TPLoad configuration steps

Follow these steps to configure TPLoad so that it performs benchmark testing for UPG:

1. Configure the **core** and **servers** sections. In this use case, set **session_management** to `pfcp`. In **servers.pfcp**, configure all parameters required for the generators to reach UPG and for the PFCP session creation. Switch off **teid_allocation_up** for the `ip-ip` case. Enable **usage_reporting**, if needed.

    ```yaml
    core:
      session_management: pfcp

    servers:
      pfcp:
        mode: ip-ip
        control:
          listen_address: 172.20.0.128
          node_fqdn: tpload.epc.mnc001.mcc001.3gppnetwork.org
          up_function_address: 172.20.0.1
        interfaces:
          left:
            up_function_address: 198.18.0.1
            network: access
            teid_allocation_up: false # gtp F-TEID allocation on UP function. This needs
          right:
            up_function_address: 198.19.0.1
            teid_allocation_up: false
            nat_pools:
              pool-de: dn0
        usage_reporting:
          enabled: true # should we create URR in the first place
          time_quota: 30s # optional
          time_threshold: 20s # optional, requires quota
          volume_quota: 1000000 # optional
          volume_threshold: 900000 # optional, requires quota
    ```

2. Set the desired UE IP range for **device_generator**:

    ```yaml
    device_generator:
      imsi:
        first: "001010100000000"
        step: 1
      mei:
        first: "2222900000000"
        step: 10
      msisdn:
        first: "444440000000"
        step: 1
      ipv4:
        first: "16.0.0.1"
        last: "16.15.255.254"
        pseudorandom: false
    ```

3. Use the `StabilityLoop` testing function for the purpose of this test case:

    ```yaml
    tests:
      - name: Loop
        function: StabilityLoop
        flows_count: 1
        parameters:
          sessions_count: 110000
          sessions_loop_count: 100000
          test_duration: 30m
        load_left:
          speed: 4 mpps
          traffic_profile: default
          burst_profile: minimal
        load_right:
          speed: 1 pps
          traffic_profile: default
          burst_profile: minimal
        rate_limits:
          create: 111
          delete: 111
    ```

4. Align network configuration with the overall network setup:

    ```yaml
    traffic_generators:
      left:
        address: 198.18.0.129+
        gateway: 198.18.0.1
        ring_size: 16384
        buffer_size: 2048
        queue_count: 1

      right:
        address: 198.19.0.129+
        gateway: 198.19.0.1
        nat_aware: true # device under test performs NAT in this setup
        ring_size: 16384
        buffer_size: 2048
        queue_count: 1

    traffic_profiles:
      - name: default
        size_from_range: { min: 50, max: 1500 }

    burst_profiles:
      - name: minimal
        count_from_range: { min: 1, max: 3 }
    ```

5. After applying the configuration, the connectivity should work as expected.
