# hewlettpackard/netperf architecture

> Architecture diagram of the GitHub repository hewlettpackard/netperf, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hewlettpackard/netperf
- Repository: https://github.com/hewlettpackard/netperf

## Overview

Netperf is a network performance benchmark for TCP, UDP, and other socket transports. The principal workflow is an operator configuring a test in the client, which coordinates with a remote netserver; transport-specific test code runs the data exchange and reports performance results. The source index identifies the client, server, shared library, and protocol-test modules, but the excerpts do not expose the complete runtime dispatch path, so those relationships are omitted or marked unverified. Platform measurement and transport variants are represented without assuming they are all enabled in a given build.

Main entry points: [`src/netlib.c`](https://github.com/hewlettpackard/netperf/blob/master/src/netlib.c) (Network runtime), [`src/netsh.c`](https://github.com/hewlettpackard/netperf/blob/master/src/netsh.c) (CLI configuration), [`src/netserver.c`](https://github.com/hewlettpackard/netperf/blob/master/src/netserver.c) (Netserver), [`src/nettest_bsd.c`](https://github.com/hewlettpackard/netperf/blob/master/src/nettest_bsd.c) (BSD sockets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Benchmark control"]
  node_client["Netperf client<br/>[netperf.c]"]
  node_server["Netserver<br/>[netserver.c]"]
  node_cli["CLI configuration<br/>[netsh.c]"]
end

subgraph group_tests["Transport tests"]
  node_bsd["BSD sockets<br/>[nettest_bsd.c]"]
  node_omni["Omni tests<br/>[nettest_omni.c]"]
  node_unix["Unix sockets<br/>[nettest_unix.c]"]
  node_dlpi["DLPI tests<br/>[nettest_dlpi.c]"]
  node_sctp["SCTP tests<br/>[nettest_sctp.c]"]
  node_sdp["SDP tests<br/>[nettest_sdp.c]"]
  node_xti["XTI tests<br/>[nettest_xti.c]"]
end

subgraph group_core["Shared runtime"]
  node_runtime["Network runtime<br/>[netlib.c]"]
  node_protocol["Test protocol definitions<br/>[netlib.h]"]
  node_hist["Latency histograms<br/>[hist.h]"]
  node_resolver["Address resolution<br/>[getaddrinfo.c]"]
end

subgraph group_platform["Platform measurement"]
  node_cpu["CPU measurement<br/>[netcpu_procstat.c]"]
  node_cpu_variants["CPU platform variants<br/>[netcpu_kstat.c]"]
  node_driver["Network driver metrics<br/>[netdrv_ethtool.c]"]
  node_system["System metrics<br/>[netsys_linux.c]"]
end

node_operator(("Operator"))
node_external_server(("Remote host"))

node_operator -.->|"configures"| node_client
node_client -.->|"runs remote test"| node_external_server
node_external_server -.->|"hosts"| node_server
node_server -->|"dispatches"| node_bsd
node_server -->|"dispatches"| node_unix
node_server -->|"dispatches"| node_dlpi
node_server -->|"dispatches"| node_sctp
node_cli -->|"references"| node_bsd
node_cli -->|"references"| node_unix
node_cli -->|"references"| node_dlpi
node_cli -->|"references"| node_sctp
node_cli -->|"references"| node_xti
node_cli -.->|"references"| node_omni
node_bsd -->|"uses"| node_runtime
node_omni -->|"uses"| node_runtime
node_sctp -->|"uses"| node_runtime
node_xti -->|"uses"| node_runtime
node_dlpi -->|"uses"| node_runtime
node_unix -->|"uses"| node_runtime
node_runtime -->|"uses definitions"| node_protocol
node_runtime -->|"uses"| node_resolver
node_bsd -->|"uses"| node_hist
node_omni -->|"uses"| node_hist
node_sctp -->|"uses"| node_hist
node_xti -->|"uses"| node_hist
node_cpu -->|"uses"| node_runtime
node_cpu_variants -->|"uses"| node_runtime

click node_client "https://github.com/hewlettpackard/netperf/blob/master/src/netperf.c"
click node_server "https://github.com/hewlettpackard/netperf/blob/master/src/netserver.c"
click node_cli "https://github.com/hewlettpackard/netperf/blob/master/src/netsh.c"
click node_bsd "https://github.com/hewlettpackard/netperf/blob/master/src/nettest_bsd.c"
click node_omni "https://github.com/hewlettpackard/netperf/blob/master/src/nettest_omni.c"
click node_unix "https://github.com/hewlettpackard/netperf/blob/master/src/nettest_unix.c"
click node_dlpi "https://github.com/hewlettpackard/netperf/blob/master/src/nettest_dlpi.c"
click node_sctp "https://github.com/hewlettpackard/netperf/blob/master/src/nettest_sctp.c"
click node_sdp "https://github.com/hewlettpackard/netperf/blob/master/src/nettest_sdp.c"
click node_xti "https://github.com/hewlettpackard/netperf/blob/master/src/nettest_xti.c"
click node_runtime "https://github.com/hewlettpackard/netperf/blob/master/src/netlib.c"
click node_protocol "https://github.com/hewlettpackard/netperf/blob/master/src/netlib.h"
click node_hist "https://github.com/hewlettpackard/netperf/blob/master/src/hist.h"
click node_resolver "https://github.com/hewlettpackard/netperf/blob/master/src/missing/getaddrinfo.c"
click node_cpu "https://github.com/hewlettpackard/netperf/blob/master/src/netcpu_procstat.c"
click node_cpu_variants "https://github.com/hewlettpackard/netperf/blob/master/src/netcpu_kstat.c"
click node_driver "https://github.com/hewlettpackard/netperf/blob/master/src/netdrv_ethtool.c"
click node_system "https://github.com/hewlettpackard/netperf/blob/master/src/netsys_linux.c"

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_server,node_cli toneBlue
class node_bsd,node_omni,node_unix,node_dlpi,node_sctp,node_sdp,node_xti toneAmber
class node_runtime,node_protocol,node_hist,node_resolver toneMint
class node_cpu,node_cpu_variants,node_driver,node_system toneRose
class node_operator,node_external_server toneIndigo
```

## Components

### Benchmark control

- [Netperf client](https://github.com/hewlettpackard/netperf/blob/master/src/netperf.c): `src/netperf.c`
- [Netserver](https://github.com/hewlettpackard/netperf/blob/master/src/netserver.c): `src/netserver.c`
- [CLI configuration](https://github.com/hewlettpackard/netperf/blob/master/src/netsh.c): `src/netsh.c`

### Transport tests

- [BSD sockets](https://github.com/hewlettpackard/netperf/blob/master/src/nettest_bsd.c): `src/nettest_bsd.c`
- [Omni tests](https://github.com/hewlettpackard/netperf/blob/master/src/nettest_omni.c): `src/nettest_omni.c`
- [Unix sockets](https://github.com/hewlettpackard/netperf/blob/master/src/nettest_unix.c): `src/nettest_unix.c`
- [DLPI tests](https://github.com/hewlettpackard/netperf/blob/master/src/nettest_dlpi.c): `src/nettest_dlpi.c`
- [SCTP tests](https://github.com/hewlettpackard/netperf/blob/master/src/nettest_sctp.c): `src/nettest_sctp.c`
- [SDP tests](https://github.com/hewlettpackard/netperf/blob/master/src/nettest_sdp.c): `src/nettest_sdp.c`
- [XTI tests](https://github.com/hewlettpackard/netperf/blob/master/src/nettest_xti.c): `src/nettest_xti.c`

### Shared runtime

- [Network runtime](https://github.com/hewlettpackard/netperf/blob/master/src/netlib.c): `src/netlib.c`
- [Test protocol definitions](https://github.com/hewlettpackard/netperf/blob/master/src/netlib.h): `src/netlib.h`
- [Latency histograms](https://github.com/hewlettpackard/netperf/blob/master/src/hist.h): `src/hist.h`
- [Address resolution](https://github.com/hewlettpackard/netperf/blob/master/src/missing/getaddrinfo.c): `src/missing/getaddrinfo.c`

### Platform measurement

- [CPU measurement](https://github.com/hewlettpackard/netperf/blob/master/src/netcpu_procstat.c): `src/netcpu_procstat.c`
- [CPU platform variants](https://github.com/hewlettpackard/netperf/blob/master/src/netcpu_kstat.c): `src/netcpu_kstat.c`
- [Network driver metrics](https://github.com/hewlettpackard/netperf/blob/master/src/netdrv_ethtool.c): `src/netdrv_ethtool.c`
- [System metrics](https://github.com/hewlettpackard/netperf/blob/master/src/netsys_linux.c): `src/netsys_linux.c`

### Other components

- **Operator**
- **Remote host**

## Connections

- Operator → Netperf client: configures
- Netperf client → Remote host: runs remote test
- Remote host → Netserver: hosts
- Netserver → BSD sockets: dispatches (evidence: `src/netserver.c`)
- Netserver → Unix sockets: dispatches (evidence: `src/netserver.c`)
- Netserver → DLPI tests: dispatches (evidence: `src/netserver.c`)
- Netserver → SCTP tests: dispatches (evidence: `src/netserver.c`)
- CLI configuration → BSD sockets: references (evidence: `src/netsh.c`)
- CLI configuration → Unix sockets: references (evidence: `src/netsh.c`)
- CLI configuration → DLPI tests: references (evidence: `src/netsh.c`)
- CLI configuration → SCTP tests: references (evidence: `src/netsh.c`)
- CLI configuration → XTI tests: references (evidence: `src/netsh.c`)
- CLI configuration → Omni tests: references
- BSD sockets → Network runtime: uses (evidence: `src/nettest_bsd.c`)
- Omni tests → Network runtime: uses (evidence: `src/nettest_omni.c`)
- SCTP tests → Network runtime: uses (evidence: `src/nettest_sctp.c`)
- XTI tests → Network runtime: uses (evidence: `src/nettest_xti.c`)
- DLPI tests → Network runtime: uses (evidence: `src/nettest_dlpi.c`)
- Unix sockets → Network runtime: uses (evidence: `src/nettest_unix.c`)
- Network runtime → Test protocol definitions: uses definitions (evidence: `src/netlib.c`)
- Network runtime → Address resolution: uses (evidence: `src/netlib.c`)
- BSD sockets → Latency histograms: uses (evidence: `src/nettest_bsd.c`)
- Omni tests → Latency histograms: uses (evidence: `src/nettest_omni.c`)
- SCTP tests → Latency histograms: uses (evidence: `src/nettest_sctp.c`)
- XTI tests → Latency histograms: uses (evidence: `src/nettest_xti.c`)
- CPU measurement → Network runtime: uses (evidence: `src/netcpu_procstat.c`)
- CPU platform variants → Network runtime: uses (evidence: `src/netcpu_kstat.c`)
