Skip to content

tierney/iperf

Repository files navigation

iperf Reverse-NAT Legacy Fork (iperf2-era)

1. Project status

This repository is a historical iperf2-era fork preserved for archaeology, reproducibility, and behavioral comparison.

It is not intended to become a broad rewrite of iperf2 or iperf3.

2. What this fork is

This tree is based on iperf 2.0.5-era code with a patch that adds reverse TCP behavior for NAT/firewall-constrained clients:

  • public server: iperf -s --reverse
  • NAT'd client: iperf -c <server> --reverse

The reverse patch is centered around:

  • --reverse / -2 option handling in src/Settings.cpp
  • DirectionMode in include/Settings.hpp
  • sender/receiver role dispatch in src/Client.cpp and src/Server.cpp
  • shared transfer helpers in src/Dataxfer.cpp

3. Why NAT'd reverse testing mattered

The historical use case was a client that could initiate outbound connections but could not accept inbound test connections. This fork's reverse mode flips data direction over the established path.

4. Quick start

Standard TCP test:

  • server: iperf -s
  • client: iperf -c <server>

Legacy reverse test:

  • server: iperf -s --reverse
  • client: iperf -c <server> --reverse

5. Build from source

From repo root:

./configure
make

If you need to regenerate autotools files:

./autogen.sh
./configure
make

6. Usage examples

See man/iperf.1 and doc/index.html for legacy CLI details.

7. Behavioral notes

  • This is an iperf2-family codebase and protocol.
  • iperf2 and iperf3 are separate and not protocol-compatible.
  • Reverse behavior in this fork is implemented as endpoint role selection (mDirection), not an iperf3 protocol port.

8. Compatibility with iperf2 / iperf3

Modern upstreams now provide reverse mode:

  • current iperf2 supports -R/--reverse
  • current iperf3 supports -R/--reverse

See docs/upstream-comparison.md and docs/iperf3-strategy.md.

9. Equivalent stock iperf3 commands

If your requirement is client-initiated reverse TCP measurement through NAT/firewall constraints:

  • server: iperf3 -s
  • client: iperf3 -c <server> -R

10. Tests

A parameterized behavior matrix is provided in:

  • tests/reverse-cases.tsv
  • tests/reverse-matrix.sh

Run:

./tests/reverse-matrix.sh

make check runs the legacy portion of this matrix (RUN_IPERF3=0) so repository-local checks stay self-contained.

Installing iperf3 for comparison

macOS:

brew install iperf3

Ubuntu/Debian:

sudo apt-get update
sudo apt-get install -y iperf3

Fedora/RHEL:

sudo dnf install -y iperf3

Verify:

iperf3 --version

Run only iperf3 matrix:

RUN_LEGACY=0 ./tests/reverse-matrix.sh

Run only legacy matrix:

RUN_IPERF3=0 ./tests/reverse-matrix.sh

Debug tips:

  • keep logs after run: KEEP_TMP=1 ./tests/reverse-matrix.sh
  • fail fast if binaries are missing: FAIL_ON_MISSING_BIN=1 ./tests/reverse-matrix.sh

11. Limitations

  • Legacy build system/tooling is old and being modernized incrementally.
  • Timing/bandwidth output is workload-dependent and should not be overfit in tests.
  • Legacy docs include historical version strings and references.

12. Historical notes

This repository preserves an iperf2-era patch lineage and historical usage pattern for reverse testing. See docs/modernization.md for archaeology and project direction.

13. License

  • This software is based on Iperf, copyright (c) 1999-2003 The Board of Trustees of the University of Illinois.
  • See COPYING and doc/ui_license.html for the original University of Illinois / NCSA Open Source License.
  • Subsequent modifications for the reverse-NAT patch are preserved under the same terms.

14. Attribution

  • Original Authors: Mark Gates, Ajay Tirumala, Kevin Gibbs, et al. (NLANR/DAST).
  • Reverse Patch: Lucas Nussbaum (lucas.nussbaum@ens-lyon.fr).
  • Modernization: Repository archaeology and build hardening (2026).

About

iperf (patched for NAT'd client-initiated reverse TCP measurements).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors