> 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-hss.md).

# Test an HSS

You can use TPLoad to perform benchmark testing for a Home Subscriber Server (HSS). In this use case, TPLoad Core simulates the MME side of the `S6a` Diameter interface. Since HSS benchmarking requires only the TPLoad Core component and generates no user plane traffic, the traffic-related sections can be omitted.

For each session creation, TPLoad sends an Authentication-Information-Request (AIR) followed by an Update-Location-Request (ULR). For each session deletion, TPLoad sends a Purge-UE-Request (PUR). The Diameter connection is established over TCP or SCTP, depending on the **servers.hss.diameter.network** parameter, with TPLoad acting as the connection initiator.

A clustered HSS can be tested from a single TPLoad instance by listing its nodes in **servers.hss.diameter.remote_addresses**. TPLoad then connects to each node and distributes the requests over all of them round-robin. See [Control Plane configuration](https://docs.cennso.com/test-tools/tpload/latest/configuration/cp-emulated-endpoints.md#hss-load-generation-configuration).

For this use case, the corresponding HSS setup has the following configuration:

| Component | Interface | Address |
|:---|:---|:---|
| HSS | ctrl | 198.18.0.16 |

TPLoad has the following addresses:

| Component | Interface | Address |
|:---|:---|:---|
| TPLoad Core | ctrl | 198.18.0.128 |

## Prerequisites

The subscribers must be provisioned on the HSS before the test starts. TPLoad takes the subscriber identities from the **device_generator.imsi** range, so every IMSI from that range must exist on the HSS. Otherwise, the corresponding requests fail with the `DIAMETER_ERROR_USER_UNKNOWN` error, and the affected sessions are not created.

## TPLoad configuration steps

Follow these steps to configure TPLoad Core to perform benchmark testing for an HSS:

1. Configure the **core** and **servers** sections. In this use case, set **session_management** to `hss`. In **servers**, configure the `hss` instance with the Diameter identities matching the HSS routing configuration.

  ```yaml
    core:
      session_management: hss
      provision_duration: 0s

    servers:
      hss:
        diameter:
          network: tcp
          remote_address: 198.18.0.16:3868
          local_address: 198.18.0.128:0
          origin_host: tpload.mme.cennso.net
          origin_realm: mme.cennso.net
          destination_realm: epc.mnc001.mcc262.3gppnetwork.org
        plmn:
          mcc: "262"
          mnc: "01"
        options:
          skip_purge: false
  ```

2. Set the IMSI range for **device_generator**. The range must match the subscribers provisioned on the HSS:

  ```yaml
      device_generator:
        imsi: { first: "262016000000000", step: 1 }
  ```

3. Use the `RampUp`, `StabilityLoop`, and `SteadyLoop` testing functions for the purpose of this test case:

  ```yaml
      tests:
        - name: rampup
          function: RampUp
          parameters:
            sessions_count: 100
            hold_time: 5s
          rate_limits:
            create: 10
            delete: 10

        - name: stability
          function: StabilityLoop
          parameters:
            sessions_count: 110
            sessions_loop_count: 100
            test_duration: 5m
          rate_limits:
            create: 10
            delete: 10

        - name: steady
          function: SteadyLoop
          parameters:
            sessions_count: 110
            sessions_loop_count: 100
            max_diff: 10
            test_duration: 5m
          rate_limits:
            create: 10
            delete: 10
  ```

4. After applying the configuration, TPLoad connects to the HSS and performs the Diameter capabilities exchange. The test can start once the connection is established.

For the full list of the configuration parameters, see [Control Plane configuration](https://docs.cennso.com/test-tools/tpload/latest/configuration/cp-emulated-endpoints.md#hss-load-generation-configuration).
