Community discussions

MikroTik App
 
User avatar
okazdal
Trainer
Trainer
Topic Author
Posts: 25
Joined: Fri Aug 07, 2015 4:44 pm
Contact:

IPERF3 server on RouterOS ARM

Thu Sep 09, 2021 5:27 pm

Hello guys,
After 7.1rc3 launch yesterday with Docker support. I wanted to try to run an iperf3 server on my RB4011.


docker pull taoyou/iperf3-alpine@sha256:e792a52a949ed14f594c611b1446e40e8318d19c48204c485eda1f951341c10c
docker save taoyou/iperf3-alpine > iperf.tar


I followed https://help.mikrotik.com/docs/display/ROS/Container


iperfonrouteros.png

If you don't want to install docker and create image yourself. You can download it from here. https://drive.google.com/file/d/1XN7D7I ... sp=sharing

Regards,

okazdal
You do not have the required permissions to view the files attached to this post.
 
Stril
Member Candidate
Member Candidate
Posts: 204
Joined: Fri Nov 12, 2010 7:18 pm

Re: IPERF3 server on RouterOS ARM

Fri Sep 10, 2021 8:52 am

Hi!

Thats great! Is there any possibility to use the docker-container as iperf3-client? My main usage for iperf would be checking LTE-connections (NAT by provider).

Thank you and best wishes
Stril
 
User avatar
deadkat
Frequent Visitor
Frequent Visitor
Posts: 57
Joined: Sun Nov 15, 2020 11:14 pm
Location: Alabama, USA

Re: IPERF3 server on RouterOS ARM

Fri Sep 10, 2021 9:30 am

Just ran through the docs page linked above and it doesn't seem to be working for me. I'm on a CHR. commands I entered are as follows
/interface veth add address=192.168.99.1/24 gateway=192.168.99.254 name=veth1 disabled=no

/interface bridge add fast-forward=no name=docker protocol-mode=none

/interface bridge port add bridge=docker interface=veth1 trusted=yes

/interface bridge settings set allow-fast-path=no

/ip address add address=192.168.99.254/24 interface=docker

/container envs
add list=iperf name=ServerIP value=192.168.99.1
add list=iperf name=TZ value=America/Chicago
add list=iperf name=WEBPASSWORD value=******

/container add envlist=iperf file=iperf.tar hostname=iperf interface=veth1 logging=yes
/container start num=0
and I get
/container print
 0 file=iperf.tar name="fcb53244-3ca7-4801-978a-df8443072a0d" tag="" os="linux" arch="arm" interface=veth1 envlist="iperf" mounts="" dns="" hostname="iperf" logging=yes status=stopped
Am I doing something wrong?

full export attached
You do not have the required permissions to view the files attached to this post.
 
krisjanisj
Member Candidate
Member Candidate
Posts: 101
Joined: Wed Feb 20, 2019 2:53 pm
Contact:

Re: IPERF3 server on RouterOS ARM

Fri Sep 10, 2021 10:00 am

Just ran through the docs page linked above and it doesn't seem to be working for me. I'm on a CHR. commands I entered are as follows
/interface veth add address=192.168.99.1/24 gateway=192.168.99.254 name=veth1 disabled=no

/interface bridge add fast-forward=no name=docker protocol-mode=none

/interface bridge port add bridge=docker interface=veth1 trusted=yes

/interface bridge settings set allow-fast-path=no

/ip address add address=192.168.99.254/24 interface=docker

/container envs
add list=iperf name=ServerIP value=192.168.99.1
add list=iperf name=TZ value=America/Chicago
add list=iperf name=WEBPASSWORD value=******

/container add envlist=iperf file=iperf.tar hostname=iperf interface=veth1 logging=yes
/container start num=0
and I get
/container print
 0 file=iperf.tar name="fcb53244-3ca7-4801-978a-df8443072a0d" tag="" os="linux" arch="arm" interface=veth1 envlist="iperf" mounts="" dns="" hostname="iperf" logging=yes status=stopped
Am I doing something wrong?

full export attached
The container posted by @okazdai is meant for ARM devices. You need to download one for amd64 architecture to be able to use it in CHR.
 
User avatar
okazdal
Trainer
Trainer
Topic Author
Posts: 25
Joined: Fri Aug 07, 2015 4:44 pm
Contact:

Re: IPERF3 server on RouterOS ARM

Fri Sep 10, 2021 10:59 am

For amd64 you just need to modify 'docker pull' command like this:
docker pull taoyou/iperf3-alpine

You can view image built for different architectures on this link
https://hub.docker.com/r/taoyou/iperf3- ... st_updated
 
User avatar
okazdal
Trainer
Trainer
Topic Author
Posts: 25
Joined: Fri Aug 07, 2015 4:44 pm
Contact:

Re: IPERF3 server on RouterOS ARM

Fri Sep 10, 2021 11:06 am

Hi!

Thats great! Is there any possibility to use the docker-container as iperf3-client? My main usage for iperf would be checking LTE-connections (NAT by provider).

Thank you and best wishes
Stril

That could be done. Same image can also be used as iperf3-client
Check out https://hub.docker.com/r/taoyou/iperf3-alpine
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 12424
Joined: Thu Mar 03, 2016 10:23 pm

Re: IPERF3 server on RouterOS ARM

Fri Sep 10, 2021 11:11 am

A word of caution: we all know that MT's own bandwidth test is a CPU hog and quite a few RB devices have CPUs too weak to saturate even one interface. Iperf3 is CPU-bound as well (possibly less than bandwidth test) and will likely have problems to saturate interfaces as well. Specially so as docker networking inevitably involves bridge (and routing/NATing depending on setup).

So running iperf3 client/server in a container will not necessarily show higher performance for those devices with weak CPU, it only offers a more standard tool for bandwidth measurements.
 
akeeltaj
just joined
Posts: 23
Joined: Fri Oct 16, 2020 9:23 pm
Location: Srinagar, India
Contact:

Re: IPERF3 server on RouterOS ARM

Sat Nov 18, 2023 8:53 am

[admin@L009] /container> shell 0
/ # iperf3 -s
iperf3: error - unable to start listener for connections: Address in use
iperf3: exiting
/ # iperf3 -c 192.168.1.10
iperf3: error - unable to connect to server: Network unreachable

I have this issue when trying to run commands on the iperf container
What am I missing?
 
User avatar
tangent
Forum Guru
Forum Guru
Posts: 1586
Joined: Thu Jul 01, 2021 3:15 pm
Contact:

Re: IPERF3 server on RouterOS ARM

Mon Nov 20, 2023 6:04 am

You don't need a container that will let you shell into it like @taoyou published to make it work. My far more stripped-down container will do this with a bit of care.

Follow all instructions up to the "add" point, then say instead:

/container
add remote-image=tangentsoft/iperf3:latest interface=veth1 cmd="-c192.168.1.10"
start 0

Immediately after hitting Enter on the third line, you should then see the router connect to the "iperf3 -s" box. This is why I didn't bother to enable "logging=yes" on the container; the successful feedback output is on the server side.

The key to making this work is to "cuddle" the -c and host options. If you put a space between them, RouterOS's bare-bones container engine isn't smart enough to parse it as two separate options and pass them as such into the container, causing iperf3's command line parser to yell about being unable to parse your request.

If you go down this path, beware that for every distinct test target IP, you will have to instantiate a new container since the "add" command bakes the IP into the instantiated container.

Also, because RouterOS doesn't cache container images like a full-featured container engine does, this means the command above will pull from Docker Hub each time before the test runs. For a few tests, this is fine, but if you're going to do this a lot, you might run into rate limiting. Copying iperf3.tar as in my docs and running from that may then be advisable.

Beware that, as @mkx says, this will not be a speed demon, giving results that aren't all that helpful. I tested this on an RB4011 which normally reports 3.4 Gbit/sec to a 10GbE client PC for a regular "forward" test, but when I had that same router act as a client to that same PC running "iperf3 -s", it only got up to an average of 1.53 Gbit/sec. Because of the cmd argument parsing weakness in RouterOS, I couldn't add iperf3's -R option to reverse the test.

Still, this does suggest an alternate workaround. Instead of setting the RouterOS box up as a client, set it up as a server per the instructions linked above, then say on the client:

$ iperf3 -R -c 192.168.88.2

…where 192.168.88.2 is your router's veth1 IP address. In my no-NAT scheme, a .1 router can have a .2 address like this. Now the iperf3 client connects to the server but then makes the server send packets back to the client, giving the desired effect without changing the container. My test results here went up to 2.51 Gbit/sec in -R mode, a far more plausible result for this setup.

Who is online

Users browsing this forum: No registered users and 7 guests