yggdrasil-network / yggdrasil-go

An experiment in scalable routing as an encrypted IPv6 overlay network

Home Page:https://yggdrasil-network.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Huge memory usage by yggdrasil process with iperf3 test in UDP mode

bjtftw opened this issue · comments

commented

I was just testing my machines over yggdrasil network with iperf3:
iperf3 -c YGGIP -R -u -b0

Yggdrasil process on server YGGIP machine (one with iperf3 -s) starts using huge amount of RAM and SWAP memory like few GB (watched this with top command). In TCP iperf3 mode everything is OK, yggdrasil is stable with low memory usage so huge UDP transfer is a problem.

Can someone look at that?

You could be actually not testing Yggdrasil/IPv6. By defaut iperf3 runs in IPv4 mode.

Your command is missing the -6 flag. I could not get iPerf3 to run in UDP mode over Ygg (which is TCP).

commented

Nope, you're not right.

Both my machines are behind NAT on different physical networks (different ISPs) so they cannot communicate directly and YGGIP in my report means 201:... address so the test was over IPv6/yggdrasil network. You don't need to use -6 switch IP address format is enough.

You can use iperf3 test over UDP, it works without -b0 parameter just test it and you will see so you're wrong here too.

Problem is when -b0 parameter is used with test (which removes default 1Mb/s speed limit in iperf3 with UDP mode).

And in the end you probably got the same problem which I'm describing here because you was unable to do the test which is exactly the bug I'm reporting just check memory usage of yggdrasil process on machine that is SENDIND data in iperf3 test.

There is some buffer overflow happening in yggdrasil or something like that.

I did not find any way to make UDP mode work with iperf3 but I could replicate the memory problem:

Running iperf3 in UDP (-u) and reverse mode (-R) causes the Yggdrasil process on the server side to fill up memory till the iperf3 process stops. Even more so it seems to DDoS Yggdrasil till it stops.

commented

I did not find any way to make UDP mode work with iperf3

Try with speed limit like iperf3 -b1M -u -c ...

Thanks, I tried that. But as long as I'm not using -R I always end up with one error or another:

$ iperf3 -b1M -u -c ygg-only.thingylabs.io
iperf3: error - unable to send control message: Bad file descriptor
$ iperf3 -u -c ygg-only.thingylabs.io
iperf3: error - unable to write to stream socket: Invalid argument
commented

Thanks, I tried that. But as long as I'm not using -R I always end up with one error or another

iperf3 -b1M -u -c ygg-only.thingylabs.io
Connecting to host ygg-only.thingylabs.io, port 5201
[ 5] local 200:... port 53271 connected to 22a:7afe:9b4b:3fc1:ca4b:e08:4e9a:2bfa port 5201
[ ID] Interval Transfer Bitrate Total Datagrams
[ 5] 0.00-1.00 sec 129 KBytes 1.06 Mbits/sec 5
[ 5] 1.00-2.00 sec 129 KBytes 1.06 Mbits/sec 5
[ 5] 2.00-3.00 sec 129 KBytes 1.06 Mbits/sec 5
[ 5] 3.00-4.00 sec 103 KBytes 848 Kbits/sec 4
[ 5] 4.00-5.00 sec 129 KBytes 1.06 Mbits/sec 5
[ 5] 5.00-6.00 sec 129 KBytes 1.06 Mbits/sec 5
[ 5] 6.00-7.00 sec 129 KBytes 1.06 Mbits/sec 5
[ 5] 7.00-8.00 sec 103 KBytes 848 Kbits/sec 4
[ 5] 8.00-9.00 sec 129 KBytes 1.06 Mbits/sec 5
[ 5] 9.00-10.00 sec 129 KBytes 1.06 Mbits/sec 5


[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
[ 5] 0.00-10.00 sec 1.21 MBytes 1.02 Mbits/sec 0.000 ms 0/48 (0%) sender
[ 5] 0.00-10.00 sec 1.21 MBytes 1.02 Mbits/sec 5054340181.850 ms 0/48 (0%) receiver

iperf Done.

For me UDP is working all the time, I can even use SCTP (iperf3 --sctp) but not on ygg-only.thingylabs.io but between my own Ubuntu 20.04 machines.