Skip to content
Explore the learning library ☟
◎ Google Translate
SanchitGurukulTechnology · Education · Innovation Take a quiz

Complete Guide to iperf Parameters and Commands

iperf Parameters and Commands with Examples

iperf is a powerful tool used to measure the bandwidth and performance of network links. Below is a comprehensive guide to the commands and parameters used in iperf Parameters.

iperf Parameters

Basic Syntax

The basic syntax foriperf Parameters (specifically iperf3, the most commonly used version) is:

Command
iperf3 [options]

Common iperf Parameters and Options

Server Mode

  • -s: Starts iperf in server mode. This command needs to be run on the server side.
Command
iperf3 -s

Client Mode

  • -c [hostname or IP]: Specifies the server to connect to. This command needs to be run on the client side.
Command
iperf3 -c 192.168.1.1

Test Duration

  • -t [time]: Sets the duration of the test in seconds. The default is 10 seconds.
Command
iperf3 -c 192.168.1.1 -t 30

Parallel Streams

  • -P [number]: Specifies the number of parallel client streams to use.
Command
iperf3 -c 192.168.1.1 -P 5

Bandwidth (for UDP tests)

  • -b [bandwidth]: Sets the target bandwidth for UDP streams (default is 1 Mbit/sec). For TCP tests, this sets the upper limit.
Command
iperf3 -c 192.168.1.1 -u -b 10M

UDP Mode

  • -u: Uses UDP rather than TCP.
Command
iperf3 -c 192.168.1.1 -u

Reverse Test

  • -R: Runs the test in reverse mode (from server to client).
Command
iperf3 -c 192.168.1.1 -R

Bidirectional Test

  • –bidir: Tests bandwidth in both directions simultaneously.
Command
iperf3 -c 192.168.1.1 --bidir

Interval

  • -i [interval]: Sets the interval time in seconds between periodic bandwidth reports.
Command
iperf3 -c 192.168.1.1 -i 1

Output Format

  • -f [format]: Sets the format of the output report (k for kilobits, m for megabits, g for gigabits).
Command
iperf3 -c 192.168.1.1 -f m

Report Format

  • -J: Outputs the report in JSON format.
Command
iperf3 -c 192.168.1.1 -J

Server Port

  • -p [port]: Specifies the port to connect to on the server (default is 5201).
Command
iperf3 -c 192.168.1.1 -p 5001

Window Size

  • -w [window size]: Sets the TCP window size.
Command
iperf3 -c 192.168.1.1 -w 256K

Advanced Options

TTL (Time to Live)

  • -T [TTL]: Sets the IP time-to-live for packets.
Command
iperf3 -c 192.168.1.1 -T 64

Bind to a Specific Interface

  • -B [host]: Binds the socket to a specific interface or IP address.
Command
iperf3 -c 192.168.1.1 -B 192.168.1.100

MSS (Maximum Segment Size)

  • -M [MSS]: Sets the TCP maximum segment size.
Command
iperf3 -c 192.168.1.1 -M 1460

Compatibility Mode

  • –cport [port]: Specifies the client-side port to use for the test.
Command
iperf3 -c 192.168.1.1 --cport 6000

Example Commands

Basic TCP Test

To perform a basic TCP test from a client to a server for 10 seconds:

  1. Start the server:
Command
iperf3 -s
  1. Run the client:
Command
iperf3 -c 192.168.1.1

UDP Test with Specified Bandwidth

To run a UDP test with a target bandwidth of 10 Mbps for 20 seconds:

  1. Start the server:
Command
iperf3 -s
  1. Run the client:
Command
iperf3 -c 192.168.1.1 -u -b 10M -t 20

Parallel Streams Test

To run a test with 5 parallel streams:

  1. Start the server:
Command
iperf3 -s
  1. Run the client:
Command
iperf3 -c 192.168.1.1 -P 5

Bidirectional Test

To test bandwidth in both directions simultaneously:

  1. Start the server:
Command
iperf3 -s
  1. Run the client:
Command
iperf3 -c 192.168.1.1 --bidir

Reverse Mode Test

To perform a reverse mode test where the server sends data to the client:

  1. Start the server:
Command
iperf3 -s
  1. Run the client:
Command
iperf3 -c 192.168.1.1 -R

Summary – iperf Parameters

iperf Parameters is a powerful and flexible tool for network performance testing, allowing you to measure bandwidth, latency, and packet loss. It supports both TCP and UDP protocols and offers a wide range of options to customize the test parameters. By understanding and utilizing these commands and parameters, you can effectively diagnose network issues, optimize performance, and validate network configurations.

Useful Links

Complete Guide to iperf Parameters and Commands

This article provided insights on the topic. For latest updates and detailed guides, stay connected with Sanchit Gurukul.

Your feedback matters

Was this post helpful?

0 reactions

SanchitGurukul — Technology • Education • Innovation

Discussion

0 approved comments

No approved comments yet. You can start the discussion below.

Leave a Comment

No login is required. Name and email are used for moderation/security. Your email is never displayed publicly. All comments require administrator approval.

This field is not used to determine whether a comment is safe.

Plain text only. File uploads, scripts, executable code, abuse and spam are not accepted.


Discover more from SanchitGurukul

Subscribe to get the latest posts sent to your email.

Keep exploring

Related guides

Namaste! I’m SG Saarthi 👋Need help learning or finding something?