Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing the localhost forwarding capabilities, the results seem unexpected. Local test: TCP forwarding speed is 13Gbps, without forwarding it’s 120Gbps, a significant difference. #378

Open
zsinba opened this issue Jul 21, 2024 · 1 comment

Comments

@zsinba
Copy link

zsinba commented Jul 21, 2024

I downloaded the source code and compiled it, then tried it on macOS.
Download time: 2024-07-21 09:37:10
Compilation script: cargo build --release
Compiled version: rathole v0.5.0-13-gbe14d12
Compiled file size: 3895544 Jul 21 09:21 rathole (3.7M Jul 21 09:21 rathole*)
Test case: examples/iperf3
Server configuration (server.toml):

[server]
bind_addr = "0.0.0.0:2333"
default_token = "123"
[server.services.iperf3-udp]
type = "udp"
bind_addr = "0.0.0.0:5202"
[server.services.iperf3-tcp]
type = "tcp"
bind_addr = "0.0.0.0:5202"

Client configuration (client.toml):

[client]
remote_addr = "127.0.0.1:2333"
default_token = "123"
[client.services.iperf3-udp]
type = "udp"
local_addr = "127.0.0.1:5201"
[client.services.iperf3-tcp]
type = "tcp"
local_addr = "127.0.0.1:5201"

Server start command:

cd /rathole/target/release
./rathole -s ../../examples/iperf3/server.toml

Client start command:

cd rathole/target/release
./rathole -c ../../examples/iperf3/client.toml

iperf3 server startup:

iperf3-darwin -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

iperf3 client startup (with Rathole):

iperf3-darwin -c 127.0.0.1 -t 100 -p 5202

The result maintained a speed of around 13Gbps.
Without Rathole forwarding, the startup command was:

iperf3-darwin -c 127.0.0.1 -t 100 -p 5201

The speed obtained was approximately 100Gbps.
For UDP testing, after forwarding through Rathole, the speed was:

iperf3-darwin -c 127.0.0.1 -t 100 -p 5202 -u

The speed was only 1Mbps.
Without Rathole, the UDP test command was:

iperf3-darwin -c 127.0.0.1 -t 100 -p 5201 -u

The speed was also 1Mbps, indicating that this might be the upper limit for UDP, and Rathole does not affect it.
Question:
When forwarding TCP, does the code limit the upper speed of the forwarding?
Note: This is just a local test, so the significance is limited, but the limitations are evident.

@zsinba zsinba changed the title 测试本机转发的能力,感觉结果有一些意外。本机测试:tcp 转发速度是13Gbps,UDP 是1Mbps,不转发是120Gbps,差别比较大。 Testing the localhost forwarding capabilities, the results seem unexpected. Local test: TCP forwarding speed is 13Gbps, without forwarding it’s 120Gbps, a significant difference. Jul 21, 2024
@Musixal
Copy link

Musixal commented Jul 21, 2024

iperf3-darwin -c 127.0.0.1 -t 100 -p 5201 -u -b 10G

for UDP you must define the bitrate. The default bitrate is 1Mb/s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants