> 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/configuration/cp-test-scenarios.md).

# Control Plane test scenarios configuration

You can configure Control Plane test scenarios in the dedicated section `tests`. This section contains the list of all test scenarios. Each test case has the following common parameters:

| Parameter | Default | Description |
|:---|:---|:---|
| name | `""` | Name of the particular test case configuration. Used as a reference in `autostart` or in the list after start. |
| function | `""` | Function used to generate a Control Plane pattern. The possible values are: `RampUp`, `StabilityLoop`, `SteadyLoop`, `MeasureRateCapacity`, `RateMeasurement`, `SessionMeasurement`, and `ThroughputMeasure`. |
| flows_count | `1` | Number of traffic flows per session |
| parameters | `{}` | This section contains function-specific test parameters. |
| load_left | `{}` | This section contains settings for the left-side generators. |
| load_right | `{}` | This section contains setting for the right-side generators. |
| rate_limits.create | `0.0` | This section contains the sessions setup rate. This value depends on the selected test function. |
| rate_limits.delete | `0.0` | This section contains the sessions teardown rate. This value depends on the selected test function. |
| rate_limits.other | `0.0` | This section contains the intermediate requests rate. |

The settings for the generators have the following options:

| Parameter | Default | Description |
|:---|:---|:---|
| speed | `0pps` | The accumulated speed for all generators from one side, in PPS or throughput. For example: `1  mpps`, `200 kpps`, `1 Mibit/s`, or `10 Gibit/s`. |
| traffic_profile | `""` | Traffic profile that is used. Must be defined in the `traffic_profiles` section. |
| burst_profile | `""` | Burst profile that is used. Must be defined in the `burst_profiles` section. |
| is_global | `false` | Disables scaling of the target speed in relation to the number of created sessions. |

## Ramp Up

Ramp Up test case is used for plain throughput measurements. It consists of the following steps:

1. Create `session_count` sessions.
2. Sleep for the `hold_time`.
3. Terminate all sessions.

| Parameter | Default | Description |
|:---|:---|:---|
| sessions_count | `0` | Number of the active sessions to be created |
| hold_time | `"0s"` | Duration of the main phase |
| send_bearer_requests | `false` | Boolean parameter to enable or disable MBRs during the test |

See the example of the Ramp Up test configuration:

```yaml
  - name: RampUp
    function: RampUp
    flows_count: 1
    parameters:
      sessions_count: 200000
      hold_time: 1h
    load_left:
      speed: 1.6 kpps
      traffic_profile: imix
      burst_profile: user_common
    load_right:
      speed: 500 Mibit/s
      traffic_profile: imix
      burst_profile: user_common
    rate_limits:
      create: 200
      delete: 200
```

## Stability Loop

Stability Loop test case includes the sessions churn during the main cycle of the run. This function uses ring as a session storage. The function should be used in the case when all requests are successful. The oldest sessions are deleted first. Each created session exists for the same period of time before deletion that equals (`sessions_loop_count`-`sessions_count`)/`rate` seconds. If the session creation fails, there is no immediate retry until next scheduled creation every `sessions_count`/`rate` seconds.

The test consists of the following steps:

1. Create `session_loop_count` sessions.
2. For the `test_duration`, create and delete sessions according to the configured rate.
3. Terminate all sessions.

| Parameter | Default | Description |
|:---|:---|:---|
| sessions_count | `0` | Size of the full pool of sessions used during the test |
| sessions_loop_count | `sessions_count/2` | Number of sessions active during each test. This value should be lower than `sessions_count` for the least used rate. |
| test_duration | `0` | Duration of the main phase |

See the example of the Stability Loop test configuration:

```yaml
  - name: StabilityLoop
    function: StabilityLoop
    flows_count: 1
    parameters:
      sessions_count: 210000
      sessions_loop_count: 200000
      test_duration: 1h
    load_left:
      speed: 1.2 mpps
      traffic_profile: imix
      burst_profile: user_common  
    load_right:
      speed: 3 mpps
      traffic_profile: imix
      burst_profile: user_common
    rate_limits:
      create: 200
      delete: 200
```

## Steady Loop

Steady Loop function acts similarly to Stability Loop, but it takes into account failed requests. It uses failed requests value as feedback for lowering the rate of the corresponding function pair. The function uses create/delete queues instead of ring. The created session goes to the end of the deleted queue and vice versa. Failed sessions are reattempted before successful ones.

The test consists of the following steps:

1. Create `session_loop_count` sessions.
2. For the `test_duration`, create and delete sessions according to the configured rate. If **max_diff** is not `0`, try to keep successful creation and deletion counters within the **max_diff** range by slowing down faster actions.
3. Terminate all sessions.

| Parameter | Default | Description |
|:---|:---|:---|
| sessions_count | `0` | Size of the full pool of sessions used during the test |
| sessions_loop_count | `sessions_count/2` | Number of sessions active during each test. This value must be lower than `sessions_count` for the least used rate. |
| test_duration | `"0s"` | Duration of the main phase |
| max_diff | `0` | Maximum possible difference between successful create and delete requests. After reaching this value, the test starts to adjust the rate. |

See the example of the Steady Loop test configuration:

```yaml
  - name: SteadyLoop
    function: SteadyLoop
    flows_count: 1
    parameters:
      sessions_count: 210000
      sessions_loop_count: 200000
      test_duration: 1h
      max_diff: 0
    load_left:
      speed: 1.2 mpps
      traffic_profile: imix
      burst_profile: user_common
    load_right:
      speed: 3 mpps
      traffic_profile: imix
      burst_profile: user_common
    rate_limits:
      create: 200
      delete: 200
```

## MeasureRateCapacity

The test consists of the following steps:

1. Create half of `sessions_count` sessions using the default rate.
2. Set rates to `start_rate`.
3. In the loop, create and delete no more than `sessions_count` sessions and change rate from `start_rate` to `target_rate` gradually over `transition_duration` time.
4. Delete created sessions.

| Parameter | Default | Description |
|:---|:---|:---|
| sessions_count | `0` | Size of the full pool of sessions used during the test |
| start_rate | `0.0` | Start rate for the transition duration |
| target_rate | `0.0` | Target rate at the transition duration |
| transition_duration | `"0s"` | Duration of the test |

See the example of the MeasureRateCapacity test configuration:

```yaml
  - name: MeasureRateCapacity
    function: MeasureRateCapacity
    flows_count: 1
    parameters:
      sessions_count: 200000
      start_rate: 500
      target_rate: 2000
      transition_duration: 1h
    load_left:
      speed: 1.2 mpps
      traffic_profile: imix
      burst_profile: user_common
    load_right:
      speed: 3 mpps
      traffic_profile: imix
      burst_profile: user_common
    rate_limits:
      create: 200
      delete: 200
```

## RateMeasurement

The test consists of the following steps:

1. Create `sessions_loop_count` sessions.
2. In the loop, create and delete sessions within the `sessions_count` range for `test_duration`.
3. Delete created sessions.

| Parameter | Default | Description |
|:---|:---|:---|
| sessions_loop_count | `sessions_count/2` | Number of sessions active during each test. This value must be lower than `sessions_count` for the least used rate. |
| sessions_count | `0` | Size of the full pool of the sessions used during the test |
| start_rate | `step_rate` | Baseline rate for test start |
| step_rate | `0` | Additional rate added on each step |
| steps | `0` | Number of steps |
| step_duration | `"0s"` | Duration of each step |

See the example of the RateMeasurement test configuration:

```yaml
  - name: RateMeasurement
    function: RateMeasurement
    flows_count: 1
    parameters:
      sessions_loop_count: 200000
      sessions_count: 210000
      step_rate: 100
      steps: 20
      step_duration: 15m
    load_left:
      speed: 1.2 mpps
      traffic_profile: imix
      burst_profile: user_common
    load_right:
      speed: 3 mpps
      traffic_profile: imix
      burst_profile: user_common
    rate_limits:
      create: 200
      delete: 200
```

## SessionMeasurement

The test consists of the following steps:

1. Create `sessions_increase_count` sessions.
2. In the loop, create and delete sessions within the `sessions_count` range for `step_duration` starting from `session_increase_count` session id.
3. Delete created sessions.
4. Repeat steps 1-3 `session_steps` times every time increasing starting session on `sessions_increase_count` amount

| Parameter | Default | Description |
|:---|:---|:---|
| sessions_increase_count | `0` | Number of sessions added for each step |
| sessions_count | `0` | Size of the full pool of sessions used during the test |
| session_steps | `0` | Number of steps |
| step_duration | `"0s"` | Duration of each step |

See the example of the SessionMeasurement test configuration:

```yaml
  - name: SessionMeasurement
    function: SessionMeasurement
    flows_count: 1
    parameters:
      sessions_increase_count: 10000
      sessions_count: 20000
      session_steps: 20
      step_duration: 15m
    load_left:
      speed: 1.2 mpps
      traffic_profile: imix
      burst_profile: user_common
    load_right:
      speed: 3 mpps
      traffic_profile: imix
      burst_profile: user_common
    rate_limits:
      create: 200
      delete: 200
```

## ThroughputMeasure

ThroughputMeasure test acts as a binary search of maximum throughput with the acceptable packet loss.
The test consists of the following steps:

| Parameter | Default | Description |
|:---|:---|:---|
| sessions_count | `0` | Size of the full pool of sessions used during the test |
| steps | `30` | Number of steps |
| step_duration | `"2m"` | Duration of each step |
| acceptable_packet_loss | `0.0` | Traffic loss threshold in percent (`2%`) or proportion (`0.02`) |

See the example of the ThroughputMeasure test configuration:

```yaml
  - name: ThroughputMeasure
    function: ThroughputMeasure
    flows_count: 1
    parameters:
      sessions_count: 1000
      steps: 30
      step_duration: 2m
      acceptable_packet_loss: 1%
    load_left:
      speed: 1.2 mpps
      traffic_profile: imix
      burst_profile: user_common
    load_right:
      speed: 3 mpps
      traffic_profile: imix
      burst_profile: user_common
    rate_limits:
      create: 200
      delete: 200
```
