> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/npp/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/components/npp/latest/concepts/mtr-test.md).

# MTR Test

`MTRTest` Custom Resource (CR) deploys a probe that runs a single My Traceroute (MTR) test within a cluster. The probe is injected into a selected pod, executes MTR tests against specified targets once, and stores hop-by-hop results in the CR `status.output` field in Prometheus exposition format.

## Pod selection

The `podSelector` field controls which pod the probe is injected into. Use label selectors to target a specific pod. The `container` field optionally pins the probe to a specific container within that pod — if omitted, a random container is used.

```yaml
spec:
  podSelector:
    labels:
      {LABEL_KEY}: {LABEL_VALUE}
  container: {CONTAINER_NAME}
```

## Test configurations

The `configurations` field defines the list of MTR tests to run. Each configuration specifies a source and a list of targets. You can also tune advanced MTR parameters per configuration: `packets` controls how many probes are sent per hop, `maxHops` limits the traceroute depth, `maxUnknownHops` stops the trace after successive unresponsive hops, and `hopSleep` sets the wait between probe packets.

```yaml
spec:
  configurations:
    - name: {CONFIGURATION_NAME}
      source: {SOURCE_ADDRESS}
      packets: {PACKET_COUNT}
      maxHops: {MAX_HOPS}
      maxUnknownHops: {MAX_UNKNOWN_HOPS}
      hopSleep: {HOP_SLEEP}
      targets:
        - name: {TARGET_NAME}
          address: {TARGET_ADDRESS}
```

### Source selection

Each configuration binds its probes to a source. Set exactly one of the following fields:

- `source` — a fixed bind address, for example `0.0.0.0` to use any interface.
- `sourceInterface` — the name of a network interface in the target pod's network namespace. The probe resolves the interface's global unicast address at run time, so it follows dynamic addresses such as User Equipment (UE) IP addresses.

```yaml
spec:
  configurations:
    - name: {CONFIGURATION_NAME}
      sourceInterface: {INTERFACE_NAME}
```

## Path MTU discovery

If `mtuDiscovery` is set to `true`, the run also discovers the per-hop path Maximum Transmission Unit (MTU) using tracepath-style probes — probes with a limited Time To Live (TTL) and the Don't Fragment (DF) flag set. The results are stored as the `mtr_hop_mtu_bytes` and `mtr_path_mtu_bytes` metrics.

The `mtuDiscoveryMode` field selects the scheduling strategy for MTU discovery probes:

- `parallel` (default) — probes all hops in each round within a single probing window.
- `sequential` — probes one hop at a time.

```yaml
spec:
  configurations:
    - name: {CONFIGURATION_NAME}
      mtuDiscovery: true
      mtuDiscoveryMode: {MTU_DISCOVERY_MODE}
```

## Timeout

The `timeout` field sets the maximum duration for each MTR test. It applies globally to all configurations; you can also override it per configuration. Durations are specified with a unit suffix, for example `30s`, `5m`, or `1h`.

```yaml
spec:
  timeout: {TIMEOUT}
```

## Read more

For all available parameters, see [MTRTest Custom Resource Definition](https://docs.cennso.com/components/npp/latest/technical-reference/npp.cennso.com_mtrtests.md).

To run a test and read results, see [Run a test](https://docs.cennso.com/components/npp/latest/guides/run-tests.md).
