Complete Guide to iperf Parameters and Commands

A-digital-illustration-depicting-routing-concepts-in-networking
11/15/2024 •

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:

      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.
      iperf3 -s
    

Client Mode

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

Test Duration

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

Parallel Streams

  • -P [number]: Specifies the number of parallel client streams to use.
      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.
      iperf3 -c 192.168.1.1 -u -b 10M
    

UDP Mode

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

Reverse Test

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

Bidirectional Test

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

Interval

  • -i [interval]: Sets the interval time in seconds between periodic bandwidth reports.
      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).
      iperf3 -c 192.168.1.1 -f m
    

Report Format

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

Server Port

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

Window Size

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

Advanced Options

TTL (Time to Live)

  • -T [TTL]: Sets the IP time-to-live for packets.
      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.
      iperf3 -c 192.168.1.1 -B 192.168.1.100
    

MSS (Maximum Segment Size)

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

Compatibility Mode

  • –cport [port]: Specifies the client-side port to use for the test.
      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:
      iperf3 -s
    
  1. Run the client:
      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:
      iperf3 -s
    
  1. Run the client:
      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:
      iperf3 -s
    
  1. Run the client:
      iperf3 -c 192.168.1.1 -P 5
    

Bidirectional Test

To test bandwidth in both directions simultaneously:

  1. Start the server:
      iperf3 -s
    
  1. Run the client:
      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:
      iperf3 -s
    
  1. Run the client:
      iperf3 -c 192.168.1.1 -R
    

Summaryiperf 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.

https://iperf.fr

https://sanchitgurukul.com/tutorials-cat

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.

Disclaimer: This article may contain information that was accurate at the time of writing but could be outdated now. Please verify details with the latest vendor advisories or contact us at admin@sanchitgurukul.com.

Discover more from

Subscribe now to keep reading and get access to the full archive.

Continue reading