# iperf3 — Network Bandwidth Measurement Tool > iperf3 is a cross-platform tool for measuring TCP, UDP, and SCTP network bandwidth performance between two endpoints, widely used for network testing and troubleshooting. ## Install Save in your project root: # iperf3 — Network Bandwidth Measurement Tool ## Quick Use ```bash # Install sudo apt install iperf3 # Debian/Ubuntu brew install iperf3 # macOS # Start a server iperf3 -s # Run a client test (from another machine) iperf3 -c server-ip # Test UDP throughput at 100Mbps iperf3 -c server-ip -u -b 100M # Test with 4 parallel streams iperf3 -c server-ip -P 4 ``` ## Introduction iperf3 is the standard tool for measuring network throughput between two hosts. Developed by ESnet at Lawrence Berkeley National Laboratory, it creates TCP or UDP data streams and measures the bandwidth, jitter, and packet loss — essential for validating network infrastructure and diagnosing bottlenecks. ## What iperf3 Does - Measures maximum TCP throughput between a client and server with configurable parameters - Tests UDP performance including bandwidth, jitter, and packet loss metrics - Supports multiple parallel streams to saturate high-bandwidth links - Reports bandwidth per-interval and as a total summary in human-readable or JSON format - Tests both directions: client-to-server, server-to-client, or bidirectional simultaneously ## Architecture Overview iperf3 is written in C and operates in a client-server model. The server listens for incoming connections and the client drives the test parameters. Data is generated in memory and transmitted over the wire — actual disk I/O is not involved. A control channel coordinates test setup and result exchange while data flows on a separate connection. JSON output mode enables programmatic integration. ## Self-Hosting & Configuration - Run `iperf3 -s` on any machine to create a test endpoint; no persistent configuration needed - Deploy as a systemd service for always-available bandwidth testing endpoints - Use `--bind` to restrict listening to specific interfaces on multi-homed servers - Authentication support via RSA keys prevents unauthorized use of public-facing iperf3 servers - Docker images available for containerized deployment: `docker run -p 5201:5201 networkstatic/iperf3 -s` ## Key Features - Measures TCP, UDP, and SCTP with configurable window sizes, buffer lengths, and MSS - JSON output mode integrates cleanly with monitoring systems and automated test suites - Zero-copy mode reduces CPU overhead for testing very high-speed links (10Gbps+) - CPU affinity binding enables testing on specific cores to isolate performance measurements - Support for SCTP protocol testing in addition to the standard TCP and UDP ## Comparison with Similar Tools - **Netperf** — older benchmark with more test types but less active development; iperf3 is the modern standard - **iperf2** — predecessor with different codebase; iperf3 is a complete rewrite with cleaner architecture - **nuttcp** — similar functionality but less widely deployed; iperf3 has broader ecosystem support - **speedtest-cli** — tests against external servers for internet speed; iperf3 measures between controlled endpoints ## FAQ **Q: What is the default port for iperf3?** A: TCP port 5201. You can change it with `-p ` on both server and client. **Q: Can iperf3 test WiFi performance?** A: Yes. Run the server on a wired machine and the client on WiFi to measure wireless throughput to the LAN. **Q: How do I measure latency with iperf3?** A: Use UDP mode (`-u`) which reports jitter. For pure latency measurement, tools like ping or irtt are more appropriate. **Q: Does iperf3 support IPv6?** A: Yes. Use `-6` flag or specify an IPv6 address directly to test over IPv6 connections. ## Sources - https://github.com/esnet/iperf - https://iperf.fr/ --- Source: https://tokrepo.com/en/workflows/asset-fbe9fc21 Author: AI Open Source