# perftool-incubator/bench-trafficgen architecture

> Architecture diagram of the GitHub repository perftool-incubator/bench-trafficgen, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/perftool-incubator/bench-trafficgen
- Repository: https://github.com/perftool-incubator/bench-trafficgen

## Overview

bench-trafficgen is a Crucible benchmark integration for generating network traffic and measuring DUT performance. The main workflow starts with the Crucible runner invoking the client wrapper, which prepares inputs and runs a binary search; each trial drives a selected traffic generator and gathers results. The repository also supports server-side testpmd, optional hardware-timestamped latency measurement, and CDM-oriented result processing. The README documents these capabilities; some implementation details are unsampled, so the graph omits uncertain wiring.

Main entry points: [`trafficgen/binary-search.py`](https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen/binary-search.py) (Binary search), [`trafficgen-client`](https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen-client) (Client wrapper), [`trafficgen/trex-txrx-profile.py`](https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen/trex-txrx-profile.py) (Profile driver), [`trafficgen/trex-txrx.py`](https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen/trex-txrx.py) (STL drivers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Benchmark orchestration"]
  node_client["Client wrapper"]
  node_base["Prerequisite helpers"]
  node_importer["Input importer"]
  node_runtime["Runtime selector"]
  node_search["Binary search<br/>[binary-search.py]"]
  node_benchconfig["Benchmark configuration<br/>[rickshaw.json]"]
end

subgraph group_traffic["Traffic generation"]
  node_stl["STL drivers<br/>[trex-txrx.py]"]
  node_stlprofile["Profile driver"]
  node_astf["ASTF driver<br/>[binary-search.py]"]
  node_profiles["ASTF profiles"]
  node_workloads["STL workloads"]
end

subgraph group_infrastructure["Generator infrastructure"]
  node_trex["TRex service"]
  node_infra["TRex launcher"]
  node_portquery["Port query<br/>[trex-query.py]"]
  node_astfquery["ASTF port query<br/>[trex-astf-query.py]"]
  node_server["Server control"]
  node_testpmd["testpmd"]
end

subgraph group_results["Measurement and results"]
  node_latency["PTP latency probe<br/>[ptp-latency.c]"]
  node_postprocess["Result postprocessor"]
  node_metrics["CDM metrics"]
end

node_crucible(("Crucible runner"))

node_crucible -->|"invokes"| node_client
node_client -->|"uses"| node_base
node_client -->|"runs"| node_search
node_client -->|"imports inputs"| node_importer
node_client -->|"uses settings"| node_benchconfig
node_search -->|"requests runtime"| node_runtime
node_search -->|"runs trials"| node_stl
node_search -->|"runs trials"| node_stlprofile
node_search -->|"runs trials"| node_astf
node_search -->|"queries ports"| node_portquery
node_search -->|"queries ports"| node_astfquery
node_search -.->|"starts probe"| node_latency
node_stl -->|"drives traffic"| node_trex
node_stlprofile -->|"drives traffic"| node_trex
node_astf -->|"drives traffic"| node_trex
node_astf -->|"loads profile"| node_profiles
node_stlprofile -->|"reads profile"| node_workloads
node_infra -->|"launches"| node_trex
node_portquery -->|"queries ports"| node_trex
node_astfquery -->|"queries ports"| node_trex
node_server -->|"starts"| node_testpmd
node_search -->|"provides results"| node_postprocess
node_postprocess -->|"emits CDM"| node_metrics

click node_client "https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen-client"
click node_base "https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen-base"
click node_importer "https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen-import-files"
click node_runtime "https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen-get-runtime"
click node_search "https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen/binary-search.py"
click node_stl "https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen/trex-txrx.py"
click node_stlprofile "https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen/trex-txrx-profile.py"
click node_astf "https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen/binary-search.py"
click node_profiles "https://github.com/perftool-incubator/bench-trafficgen/tree/main/trafficgen/astf-profiles"
click node_workloads "https://github.com/perftool-incubator/bench-trafficgen/tree/main/trafficgen/trex-profiles/workloads"
click node_infra "https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen-infra"
click node_portquery "https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen/trex-query.py"
click node_astfquery "https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen/trex-astf-query.py"
click node_server "https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen-server-start"
click node_latency "https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen/ptp-latency.c"
click node_postprocess "https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen-post-process.py"
click node_benchconfig "https://github.com/perftool-incubator/bench-trafficgen/blob/main/rickshaw.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_client,node_base,node_importer,node_runtime,node_search,node_benchconfig toneBlue
class node_stl,node_stlprofile,node_astf,node_profiles,node_workloads toneAmber
class node_trex,node_infra,node_portquery,node_astfquery,node_server,node_testpmd toneMint
class node_latency,node_postprocess,node_metrics toneRose
class node_crucible toneIndigo
```

## Components

### Benchmark orchestration

- [Client wrapper](https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen-client): `trafficgen-client`
- [Prerequisite helpers](https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen-base): `trafficgen-base`
- [Input importer](https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen-import-files): `trafficgen-import-files`
- [Runtime selector](https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen-get-runtime): `trafficgen-get-runtime`
- [Binary search](https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen/binary-search.py): `trafficgen/binary-search.py`
- [Benchmark configuration](https://github.com/perftool-incubator/bench-trafficgen/blob/main/rickshaw.json): `rickshaw.json`

### Traffic generation

- [STL drivers](https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen/trex-txrx.py): `trafficgen/trex-txrx.py`
- [Profile driver](https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen/trex-txrx-profile.py): `trafficgen/trex-txrx-profile.py`
- [ASTF driver](https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen/binary-search.py): `trafficgen/binary-search.py`
- [ASTF profiles](https://github.com/perftool-incubator/bench-trafficgen/tree/main/trafficgen/astf-profiles): `trafficgen/astf-profiles`
- [STL workloads](https://github.com/perftool-incubator/bench-trafficgen/tree/main/trafficgen/trex-profiles/workloads): `trafficgen/trex-profiles/workloads`

### Generator infrastructure

- **TRex service**
- [TRex launcher](https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen-infra): `trafficgen-infra`
- [Port query](https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen/trex-query.py): `trafficgen/trex-query.py`
- [ASTF port query](https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen/trex-astf-query.py): `trafficgen/trex-astf-query.py`
- [Server control](https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen-server-start): `trafficgen-server-start`
- **testpmd**

### Measurement and results

- [PTP latency probe](https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen/ptp-latency.c): `trafficgen/ptp-latency.c`
- [Result postprocessor](https://github.com/perftool-incubator/bench-trafficgen/blob/main/trafficgen-post-process.py): `trafficgen-post-process.py`
- **CDM metrics**

### Other components

- **Crucible runner**

## Connections

- Crucible runner → Client wrapper: invokes
- Client wrapper → Prerequisite helpers: uses
- Client wrapper → Binary search: runs
- Client wrapper → Input importer: imports inputs
- Client wrapper → Benchmark configuration: uses settings
- Binary search → Runtime selector: requests runtime
- Binary search → STL drivers: runs trials
- Binary search → Profile driver: runs trials
- Binary search → ASTF driver: runs trials
- Binary search → Port query: queries ports
- Binary search → ASTF port query: queries ports
- Binary search → PTP latency probe: starts probe
- STL drivers → TRex service: drives traffic
- Profile driver → TRex service: drives traffic
- ASTF driver → TRex service: drives traffic
- ASTF driver → ASTF profiles: loads profile
- Profile driver → STL workloads: reads profile
- TRex launcher → TRex service: launches
- Port query → TRex service: queries ports
- ASTF port query → TRex service: queries ports
- Server control → testpmd: starts
- Binary search → Result postprocessor: provides results
- Result postprocessor → CDM metrics: emits CDM
