netperf is a benchmark tool designed to measure various aspects of network performance. It can measure unidirectional throughput, request/response performance, and provides insights into latency and bandwidth between systems. Used extensively in network engineering and performance tuning, netperf helps identify bottlenecks and validate network configurations.
📑 Table of Contents
Key Features
- TCP Throughput – Measure streaming TCP performance
- UDP Throughput – Test UDP bandwidth capabilities
- Request/Response – Measure transaction rates and latency
- Multiple Tests – TCP_STREAM, UDP_STREAM, TCP_RR, and more
- Buffer Sizing – Test with various socket buffer sizes
- Confidence Intervals – Statistical analysis of results
Installation
# Debian/Ubuntu
sudo apt install netperf
# RHEL/CentOS/Fedora
sudo dnf install netperf
# Arch Linux (AUR)
yay -S netperf
# Build from source
wget ftp://ftp.netperf.org/netperf/netperf-2.7.0.tar.gz
tar xzf netperf-2.7.0.tar.gz
cd netperf-2.7.0 && ./configure && make && sudo make install
Common Usage Examples
# Start server
netserver
# TCP throughput test
netperf -H server_ip -t TCP_STREAM
# UDP throughput test
netperf -H server_ip -t UDP_STREAM
# TCP request/response test
netperf -H server_ip -t TCP_RR
# Test with specific duration
netperf -H server_ip -l 60
# Specify message size
netperf -H server_ip -t TCP_STREAM -- -m 1024
# Multiple iterations with confidence
netperf -H server_ip -i 10,3 -I 99,5
Test Types
TCP_STREAM measures bulk data throughput, UDP_STREAM tests UDP bandwidth, TCP_RR measures transaction rate, TCP_CRR tests connection setup overhead, and UDP_RR benchmarks UDP request/response performance.
Use Cases
netperf is invaluable for network capacity planning, comparing network configurations, validating QoS settings, troubleshooting performance issues, and benchmarking new hardware.
Was this article helpful?