Git Product home page Git Product logo

iperf3's Introduction

iperf3

iPerf3 image CI

IPerf3 Docker Build for Network Performance and Bandwidth Testing

Image on Docker Hub hub.docker.com/r/networkstatic/iperf3/

Run

docker run -it --rm -p 5201:5201 networkstatic/iperf3 --help

Usage

To test bandwidth between two containers, start a server (listener) and point a client container (initiator) at the server.

Iperf3 Server

Start a listener service on port 5201 and name the container "iperf3-server":

docker run  -it --rm --name=iperf3-server -p 5201:5201 networkstatic/iperf3 -s

That returns an iperf3 process bound to a socket waiting for new connections:

-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

Iperf3 Client Side

First, get the IP address of the new server container you just started:

docker inspect --format "{{ .NetworkSettings.IPAddress }}" iperf3-server
(Returned) 172.17.0.163

Next, initiate a client connection from another container to measure the bandwidth between the two endpoints.

Run a client container pointing at the server service IP address.

Note if you are new to Docker, the --rm flag will destroy the container after the test runs. I also left out explicitly naming the container on the client side since I don't need its IP address. I typically explicitly name containers for organization and to maintain a consistent pattern.

docker run  -it --rm networkstatic/iperf3 -c 172.17.0.163

And the output is the following:

Connecting to host 172.17.0.163, port 5201
[  4] local 172.17.0.191 port 51148 connected to 172.17.0.163 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  4.16 GBytes  35.7 Gbits/sec    0    468 KBytes
[  4]   1.00-2.00   sec  4.10 GBytes  35.2 Gbits/sec    0    632 KBytes
[  4]   2.00-3.00   sec  4.28 GBytes  36.8 Gbits/sec    0   1.02 MBytes
[  4]   3.00-4.00   sec  4.25 GBytes  36.5 Gbits/sec    0   1.28 MBytes
[  4]   4.00-5.00   sec  4.20 GBytes  36.0 Gbits/sec    0   1.37 MBytes
[  4]   5.00-6.00   sec  4.23 GBytes  36.3 Gbits/sec    0   1.40 MBytes
[  4]   6.00-7.00   sec  4.17 GBytes  35.8 Gbits/sec    0   1.40 MBytes
[  4]   7.00-8.00   sec  4.14 GBytes  35.6 Gbits/sec    0   1.40 MBytes
[  4]   8.00-9.00   sec  4.29 GBytes  36.8 Gbits/sec    0   1.64 MBytes
[  4]   9.00-10.00  sec  4.15 GBytes  35.7 Gbits/sec    0   1.68 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec  42.0 GBytes  36.1 Gbits/sec    0             sender
[  4]   0.00-10.00  sec  42.0 GBytes  36.0 Gbits/sec                  receiver

iperf Done.

Or you can do something fancier in a one liner like so (docker ps -ql returns the CID e.g. container ID of the last container started which would be the server we want in this case)

docker run  -it --rm networkstatic/iperf3 -c $(docker inspect --format "{{ .NetworkSettings.IPAddress }}" $(docker ps -ql))
Connecting to host 172.17.0.193, port 5201
[  4] local 172.17.0.194 port 60922 connected to 172.17.0.193 port 5201
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  4.32 GBytes  37.1 Gbits/sec    0    877 KBytes
[  4]   1.00-2.00   sec  4.28 GBytes  36.7 Gbits/sec    0   1.01 MBytes
[  4]   2.00-3.00   sec  4.18 GBytes  35.9 Gbits/sec    0   1.01 MBytes
[  4]   3.00-4.00   sec  4.23 GBytes  36.3 Gbits/sec    0   1.13 MBytes
[  4]   4.00-5.00   sec  4.20 GBytes  36.1 Gbits/sec    0   1.27 MBytes
[  4]   5.00-6.00   sec  4.19 GBytes  36.0 Gbits/sec    0   1.29 MBytes
[  4]   6.00-7.00   sec  4.17 GBytes  35.8 Gbits/sec    0   1.29 MBytes
[  4]   7.00-8.00   sec  4.17 GBytes  35.8 Gbits/sec    0   1.29 MBytes
[  4]   8.00-9.00   sec  4.17 GBytes  35.8 Gbits/sec    0   1.29 MBytes
[  4]   9.00-10.00  sec  4.22 GBytes  36.3 Gbits/sec    0   1.29 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec  42.1 GBytes  36.2 Gbits/sec    0             sender
[  4]   0.00-10.00  sec  42.1 GBytes  36.2 Gbits/sec                  receiver

iperf Done.

Iperf3 Client Side

You can use a public iperf3 server to measure your Internet speed

docker run  -it --rm networkstatic/iperf3  -c ams.speedtest.clouvider.net -p 5208  -R -P15

The downstream speed is in the last line:

[SUM]   0.00-10.00  sec  2.72 GBytes  2.34 Gbits/sec                  receiver

So in this case: 2.34 Gbits/sec

Thanks to ESNET for re-rolling iperf from the ground up. It is a killer piece of software.

iperf3's People

Contributors

archont94 avatar isaiahtaylor avatar nerdalert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iperf3's Issues

Synology Docker container not specifying -c or -s so it fails.

Hello Nerdalert! First let me start by saying I have used this container for a long time and it has helped me troubleshoot a lot of things.

However, I picked up a new Synology and was trying to toss iperf on it as well. However, getting an error saying the following:
"iperf3: parameter error - must either be a client (-c) or server (-s)"

If I enable restart-auto, it just cycles over and over. Any thing I can do to fix this or is there any other information you need, please let me know.

1817+ Synology DSM: 7.7.7-42962
Docker: 20.10.3-1308

Bandwidth Limits

I'm currently running this docker on my Synology NAS which has a 4Gbit LACP connection to the switch.
Connected to the same switch is my pc via a 2Gbit LACP connection.

However, when I run the iperf docker in server mode, I can't get above 900Mb from PC to NAS.
Where I'd expect to at least get 2Gbit....

What am I missing?

c:\iperf-3.1.3-win64>iperf3.exe -c 192.168.1.2 
Connecting to host 192.168.1.2 , port 5201
[  4] local 192.168.1.28 port 20741 connected to 192.168.1.2 port 5201
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-1.00   sec   109 MBytes   915 Mbits/sec
[  4]   1.00-2.00   sec   110 MBytes   920 Mbits/sec
[  4]   2.00-3.00   sec   112 MBytes   941 Mbits/sec
[  4]   3.00-4.00   sec   109 MBytes   913 Mbits/sec
[  4]   4.00-5.00   sec   110 MBytes   927 Mbits/sec
[  4]   5.00-6.00   sec   109 MBytes   915 Mbits/sec
[  4]   6.00-7.00   sec   111 MBytes   933 Mbits/sec
[  4]   7.00-8.00   sec   108 MBytes   906 Mbits/sec
[  4]   8.00-9.00   sec   109 MBytes   917 Mbits/sec
[  4]   9.00-10.00  sec   111 MBytes   929 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-10.00  sec  1.07 GBytes   921 Mbits/sec                  sender
[  4]   0.00-10.00  sec  1.07 GBytes   921 Mbits/sec                  receiver

Iperf IP address with macvlan

Hello

I have tried to use this container where it is associated with a macvlan virtual interface, but when doing so I do not get an ip address assigned to the container running iperf

Therefore I have some questions
Q1

  • Is this a supported configuration, I am using postman , rhce 8, and the driver macvlan for the network namespace while using a vlan subinterface as parent interface
    The issue I saw is that a IP address was not assigned to the iperf container
  • I tested a busybox Image and that is working using the same network name space , while ip is also assigned correctly

Q2

  • when doing docker login ( podman login) to that container I have a prompt for admin/password to access the iperf container . What are this credentials ?

Thanks in advance

Can we use environment variables to set client/server?

Hi, I'm using this on a Synology NAS which is all GUI Docker manager so environment variables are the only way to affect a docker on startup. Is it possible to pass in an environment variable to specify server or client + ip? Thanks

iperf client in docker and without docker shows different statistics

Hi,
I have found a huge difference between an output of iperf client and iperf client wrapped in docker:

Output from iperf client
`
[centos@host ~]$ iperf3 -A 0 -u -c 10.10.0.35 -p 44500 -b 0 --get-server-output
Connecting to host 10.10.0.35, port 44500
[ 4] local 10.10.252.57 port 51291 connected to 10.10.0.35 port 44500
[ ID] Interval Transfer Bandwidth Total Datagrams
[ 4] 0.00-1.00 sec 462 MBytes 3.88 Gbits/sec 334810
[ 4] 1.00-2.00 sec 465 MBytes 3.90 Gbits/sec 336830
[ 4] 2.00-3.00 sec 467 MBytes 3.92 Gbits/sec 338180
[ 4] 3.00-4.00 sec 464 MBytes 3.90 Gbits/sec 336250
[ 4] 4.00-5.00 sec 461 MBytes 3.87 Gbits/sec 334170
[ 4] 5.00-6.00 sec 473 MBytes 3.97 Gbits/sec 342780
[ 4] 6.00-7.00 sec 469 MBytes 3.93 Gbits/sec 339580
[ 4] 7.00-8.00 sec 470 MBytes 3.94 Gbits/sec 340370
[ 4] 8.00-9.00 sec 475 MBytes 3.98 Gbits/sec 343810
[ 4] 9.00-10.00 sec 477 MBytes 4.00 Gbits/sec 345150


[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 4] 0.00-10.00 sec 4.57 GBytes 3.93 Gbits/sec 0.015 ms 2518789/3390887 (74%)
[ 4] Sent 3390887 datagrams

Server output:

Accepted connection from 10.10.252.57, port 37124
[ 5] local 172.17.0.2 port 5201 connected to 10.10.252.57 port 51291
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 5] 0.00-1.00 sec 162 MBytes 1.36 Gbits/sec 0.019 ms 203325/320725 (63%)
[ 5] 1.00-2.00 sec 114 MBytes 956 Mbits/sec 0.019 ms 254055/336558 (75%)
[ 5] 2.00-3.00 sec 116 MBytes 971 Mbits/sec 0.022 ms 254417/338231 (75%)
[ 5] 3.00-4.00 sec 116 MBytes 971 Mbits/sec 0.019 ms 252429/336232 (75%)
[ 5] 4.00-5.00 sec 116 MBytes 969 Mbits/sec 0.020 ms 250155/333833 (75%)
[ 5] 5.00-6.00 sec 116 MBytes 971 Mbits/sec 0.018 ms 259051/342872 (76%)
[ 5] 6.00-7.00 sec 115 MBytes 967 Mbits/sec 0.020 ms 256176/339650 (75%)
[ 5] 7.00-8.00 sec 114 MBytes 959 Mbits/sec 0.022 ms 257370/340171 (76%)
[ 5] 8.00-9.00 sec 116 MBytes 969 Mbits/sec 0.012 ms 260174/343846 (76%)
[ 5] 9.00-10.00 sec 116 MBytes 971 Mbits/sec 0.018 ms 261258/345077 (76%)

iperf Done.
`

Output from iperf client wrapped in docker:
`[centos@host ~]$ sudo docker run -it --rm networkstatic/iperf3 -A 0 -u -c 10.10.0.35 -p 44500 -b 0 --get-server-output
Connecting to host 10.10.0.35, port 44500
[ 4] local 172.17.0.5 port 34345 connected to 10.10.0.35 port 44500
[ ID] Interval Transfer Bandwidth Total Datagrams
[ 4] 0.00-1.00 sec 718 MBytes 6.02 Gbits/sec 91940
[ 4] 1.00-2.00 sec 724 MBytes 6.07 Gbits/sec 92650
[ 4] 2.00-3.00 sec 722 MBytes 6.06 Gbits/sec 92470
[ 4] 3.00-4.00 sec 723 MBytes 6.07 Gbits/sec 92570
[ 4] 4.00-5.00 sec 713 MBytes 5.98 Gbits/sec 91290
[ 4] 5.00-6.00 sec 715 MBytes 6.00 Gbits/sec 91570
[ 4] 6.00-7.00 sec 713 MBytes 5.98 Gbits/sec 91290
[ 4] 7.00-8.00 sec 719 MBytes 6.03 Gbits/sec 92000
[ 4] 8.00-9.00 sec 719 MBytes 6.03 Gbits/sec 92080
[ 4] 9.00-10.00 sec 728 MBytes 6.10 Gbits/sec 93150


[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 4] 0.00-10.00 sec 7.03 GBytes 6.04 Gbits/sec 0.149 ms 804838/806269 (1e+02%)
[ 4] Sent 806269 datagrams

Server output:

Accepted connection from 10.10.252.57, port 52422
[ 5] local 172.17.0.2 port 5201 connected to 10.10.252.57 port 34345
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 5] 0.00-1.00 sec 11.1 MBytes 93.2 Mbits/sec 0.065 ms 62345/63768 (98%)
[ 5] 1.00-2.00 sec 8.00 KBytes 65.5 Kbits/sec 0.103 ms 28172/28173 (1e+02%)
[ 5] 2.00-3.00 sec 0.00 Bytes 0.00 bits/sec 0.103 ms 0/0 (-nan%)
[ 5] 3.00-4.00 sec 8.00 KBytes 65.6 Kbits/sec 0.099 ms 221510/221511 (1e+02%)
[ 5] 4.00-5.00 sec 0.00 Bytes 0.00 bits/sec 0.099 ms 0/0 (-nan%)
[ 5] 5.00-6.00 sec 0.00 Bytes 0.00 bits/sec 0.099 ms 0/0 (-nan%)
[ 5] 6.00-7.00 sec 0.00 Bytes 0.00 bits/sec 0.099 ms 0/0 (-nan%)
[ 5] 7.00-8.00 sec 0.00 Bytes 0.00 bits/sec 0.099 ms 0/0 (-nan%)
[ 5] 8.00-9.00 sec 48.0 KBytes 394 Kbits/sec 0.149 ms 492811/492817 (1e+02%)
[ 5] 9.00-10.00 sec 0.00 Bytes 0.00 bits/sec 0.149 ms 0/0 (-nan%)

iperf Done.
`

Do we need to launch docker in a special mode to receive more accurate output?

How to use iperf to measure the network parameters of a container(virtual firewall) between two containers?

Hello, I am sorry to disturb you.
I would like to ask how to use iperf to measure the network parameters of the container between the iperf-client and iperf-server container. I would like to measure the network parameters of an intermediate container (e.g. vFW), but every time I generate traffic using iperf-client, the traffic is transferred directly from the iperf-client container to the iperf-server container and does not pass through the intermediate container. How can I solve this problem please?

Error when launching

Hi,
I receive this issue when i try to launch the packet in docker on my synology:

Create container networkstatic-iperf31 failed: {"message":"error creating overlay mount to /volume1/@docker/overlay2/2eaf13a2b42b6eba2378f3fbe27c47a7e49eb416c0354a3b2f021de490e77d93-init/merged: invalid argument"}.

Thanks for your help.

Update dockerhub image with the latest iperf3 version

Feature request:

Hello @nerdalert and @isaiahtaylor ,

After using networkstatic/iperf3 image from docker hub, I've seen that it uses version 3.0.7, meanwhile version 3.6 is available. Will you guys build and publish the new version?

/# iperf3 --version
iperf 3.0.7

Latest version (after building using this repo's Dockerfile):

docker run -it --rm -p 5201:5201 cosminpetru/iperf3 --version
iperf 3.6 (cJSON 1.5.2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.