Gost隧道性能测试(协议速度横向对比)
背景
一直有个疑问,Gost隧道的哪个协议的速度最快,延迟最低。今天群里的朋友讨论到协议的选择,当然每个人都有不同的看法。不过没有定论,经过在线查询也找不到测试的文章,所以这次做一个吃力不讨好的工作,做为日后协议选择参考。
Gost是什么,见官方文档:https://v2.gost.run
本次测试主要测试极速,不测试延迟。使用的测试软件为iperf3。
测试的协议包含常用加密和不加密协议,包含是否带relay,共需测12次:
- [ws, wss, tls] + [relay]
- [mws, mwss, mtls] + [relay]
为了让结果更具参考性,所以加上一个不采用gost中转的基准测试,和采用gost中转的tcp协议模式。
测试结果汇总表:
测试过程
基准测试:
测试Iperf本地裸连速度
在本地debian服务器上开启一个iperf3服务[窗口1]:
root@debianbt:~# iperf3 -s -p 8888
-----------------------------------------------------------
Server listening on 8888
-----------------------------------------------------------
另开一个窗口[窗口2]运行数据传输命令:
root@debianbt:~# iperf3 -c 127.0.0.1 -p 8888 -t 3
Connecting to host 127.0.0.1, port 8888
[ 5] local 127.0.0.1 port 45934 connected to 127.0.0.1 port 8888
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 2.88 GBytes 24.7 Gbits/sec 0 2.50 MBytes
[ 5] 1.00-2.00 sec 2.88 GBytes 24.8 Gbits/sec 0 2.50 MBytes
[ 5] 2.00-3.00 sec 2.92 GBytes 25.1 Gbits/sec 0 2.50 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-3.00 sec 8.68 GBytes 24.9 Gbits/sec 0 sender
[ 5] 0.00-3.04 sec 8.67 GBytes 24.5 Gbits/sec receiver receiver
得到`iperf3裸连传输速度为25G`。
测试iperf3经gost tcp协议直接中转后速度
再开一个窗口[窗口3],输入命令:
root@debianbt:~# ./gost -L "tcp://:1000/127.0.0.1:8888"
2022/04/21 20:27:03 route.go:679: tcp://:1000 on [::]:1000
在[窗口2]中通过gost中转测速:
root@debianbt:~# iperf3 -c 127.0.0.1 -p 1000 -t 3
Connecting to host 127.0.0.1, port 1000
[ 5] local 127.0.0.1 port 54386 connected to 127.0.0.1 port 1000
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 1.39 GBytes 11.9 Gbits/sec 0 2.50 MBytes
[ 5] 1.00-2.00 sec 1.39 GBytes 11.9 Gbits/sec 0 2.50 MBytes
[ 5] 2.00-3.00 sec 1.45 GBytes 12.5 Gbits/sec 0 2.50 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-3.00 sec 4.22 GBytes 12.1 Gbits/sec 0 sender
[ 5] 0.00-3.04 sec 4.22 GBytes 11.9 Gbits/sec receiver
得到`通过gost直接tcp中转速度为12G`【分析原因为本地测速,所以速度约为极速一半】
测试ws, wss, tls协议
测试ws协议
新开一个[窗口4]模拟落地机,输入命令:
root@debianbt:~# ./gost -L "ws://:2000"
2022/04/21 20:36:11 route.go:679: ws://:2000 on [::]:2000
用[窗口3]模拟中转机,命令修改为:
root@debianbt:~# ./gost -L "tcp://:1000/127.0.0.1:8888" -F "ws://127.0.0.1:2000"
2022/04/21 20:39:32 route.go:679: tcp://:1000 on [::]:10000
在[窗口2]中运行测速命令:
root@debianbt:~# iperf3 -c 127.0.0.1 -p 1000 -t 3
Connecting to host 127.0.0.1, port 1000
[ 5] local 127.0.0.1 port 54458 connected to 127.0.0.1 port 1000
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 170 MBytes 1.42 Gbits/sec 0 1.25 MBytes
[ 5] 1.00-2.00 sec 165 MBytes 1.38 Gbits/sec 0 1.25 MBytes
[ 5] 2.00-3.00 sec 164 MBytes 1.37 Gbits/sec 0 1.25 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-3.00 sec 498 MBytes 1.39 Gbits/sec 0 sender
[ 5] 0.00-3.05 sec 487 MBytes 1.34 Gbits/sec receiver
得到的测速结果`ws协议中转速度1.35G`
测试wss协议
修改[窗口4]命令为:
./gost -L "wss://:2000?cert=isir.crt&key=isir.key"
2022/04/21 20:47:42 route.go:679: wss://:2000 on [::]:2000
修改[窗口3]命令为:
root@debianbt:~# ./gost -L "tcp://:1000/127.0.0.1:8888" -F "wss://127.0.0.1:2000"
2022/04/21 20:44:12 route.go:679: tcp://:1000 on [::]:1000
在窗口2中运行测速命令:
root@debianbt:~# iperf3 -c 127.0.0.1 -p 1000 -t 3
Connecting to host 127.0.0.1, port 1000
[ 5] local 127.0.0.1 port 54474 connected to 127.0.0.1 port 1000
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 140 MBytes 1.17 Gbits/sec 0 2.50 MBytes
[ 5] 1.00-2.00 sec 135 MBytes 1.13 Gbits/sec 0 2.50 MBytes
[ 5] 2.00-3.00 sec 129 MBytes 1.08 Gbits/sec 1 2.50 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-3.00 sec 403 MBytes 1.13 Gbits/sec 1 sender
[ 5] 0.00-3.05 sec 392 MBytes 1.08 Gbits/sec receiver
得到测速结果`wss协议中转速度1.1G`
测试tls协议
修改[窗口4]命令为:
root@debianbt:~# ./gost -L "tls://:2000?cert=isir.crt&key=isir.key"
2022/04/21 20:48:40 route.go:679: tls://:2000 on [::]:2000
修改[窗口3]命令为:
root@debianbt:~# ./gost -L "tcp://:1000/127.0.0.1:8888" -F "tls://127.0.0.1:2000"
2022/04/21 20:48:46 route.go:679: tcp://:1000 on [::]:1000
在窗口2中运行测速命令:
root@debianbt:~# iperf3 -c 127.0.0.1 -p 1000 -t 3
Connecting to host 127.0.0.1, port 1000
[ 5] local 127.0.0.1 port 54498 connected to 127.0.0.1 port 1000
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 289 MBytes 2.42 Gbits/sec 0 1.50 MBytes
[ 5] 1.00-2.00 sec 255 MBytes 2.14 Gbits/sec 0 1.50 MBytes
[ 5] 2.00-3.00 sec 266 MBytes 2.23 Gbits/sec 0 1.50 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-3.00 sec 809 MBytes 2.26 Gbits/sec 0 sender
[ 5] 0.00-3.05 sec 798 MBytes 2.20 Gbits/sec receiver
得到测速结果`tls协议中转速度2.23G`
测试[ws, wss, tls] + [relay]协议
测试relay+ws协议
修改[窗口4]命令为:
root@debianbt:~# ./gost -L "relay+ws://:2000"
2022/04/21 20:50:07 route.go:679: relay+ws://:2000 on [::]:2000
修改[窗口3]命令为:
root@debianbt:~# ./gost -L "tcp://:1000/127.0.0.1:8888" -F "relay+ws://127.0.0.1:2000"
2022/04/21 20:50:28 route.go:679: tcp://:1000 on [::]:1000
在窗口2中运行测速命令:
root@debianbt:~# iperf3 -c 127.0.0.1 -p 1000 -t 3
Connecting to host 127.0.0.1, port 1000
[ 5] local 127.0.0.1 port 54510 connected to 127.0.0.1 port 1000
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 169 MBytes 1.42 Gbits/sec 0 1.25 MBytes
[ 5] 1.00-2.00 sec 160 MBytes 1.34 Gbits/sec 0 1.25 MBytes
[ 5] 2.00-3.00 sec 165 MBytes 1.38 Gbits/sec 0 1.25 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-3.00 sec 494 MBytes 1.38 Gbits/sec 0 sender
[ 5] 0.00-3.04 sec 482 MBytes 1.33 Gbits/sec receiver
得到测速结果`relay+ws协议中转速度1.35G`
测试relay+wss协议
修改[窗口4]命令为:
root@debianbt:~# ./gost -L "relay+wss://:2000?cert=isir.crt&key=isir.key"
2022/04/21 20:53:05 route.go:679: relay+wss://:2000 on [::]:2000
修改[窗口3]命令为:
root@debianbt:~# ./gost -L "tcp://:1000/127.0.0.1:8888" -F "relay+wss://127.0.0.1:2000"
2022/04/21 20:53:32 route.go:679: tcp://:1000 on [::]:1000
在窗口2中运行测速命令:
root@debianbt:~# iperf3 -c 127.0.0.1 -p 1000 -t 3
Connecting to host 127.0.0.1, port 1000
[ 5] local 127.0.0.1 port 54522 connected to 127.0.0.1 port 1000
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 137 MBytes 1.15 Gbits/sec 0 1.31 MBytes
[ 5] 1.00-2.00 sec 134 MBytes 1.12 Gbits/sec 0 1.31 MBytes
[ 5] 2.00-3.00 sec 132 MBytes 1.11 Gbits/sec 0 1.31 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-3.00 sec 403 MBytes 1.13 Gbits/sec 0 sender
[ 5] 0.00-3.05 sec 393 MBytes 1.08 Gbits/sec receiver
得到测速结果`relay+wss协议中转速度1.1G`
测试relay+tls协议
修改[窗口4]命令为:
root@debianbt:~# ./gost -L "relay+tls://:2000?cert=isir.crt&key=isir.key"
2022/04/21 20:54:42 route.go:679: relay+tls://:2000 on [::]:2000
修改[窗口3]命令为:
root@debianbt:~# ./gost -L "tcp://:1000/127.0.0.1:8888" -F "relay+tls://127.0.0.1:2000"
2022/04/21 20:54:49 route.go:679: tcp://:1000 on [::]:1000
在窗口2中运行测速命令:
root@debianbt:~# iperf3 -c 127.0.0.1 -p 1000 -t 3
Connecting to host 127.0.0.1, port 1000
[ 5] local 127.0.0.1 port 54534 connected to 127.0.0.1 port 1000
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 190 MBytes 1.59 Gbits/sec 0 1.44 MBytes
[ 5] 1.00-2.00 sec 185 MBytes 1.55 Gbits/sec 0 1.44 MBytes
[ 5] 2.00-3.00 sec 186 MBytes 1.56 Gbits/sec 0 1.44 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-3.00 sec 561 MBytes 1.57 Gbits/sec 0 sender
[ 5] 0.00-3.06 sec 557 MBytes 1.53 Gbits/sec receiver
得到测速结果`relay+tls协议中转速度1.55G`
测试mws, mwss, mtls协议
同样方式测速:
得到测速结果`mws协议中转速度1.43G`
得到测速结果`mwss协议中转速度1.1G`
得到测速结果`mtls协议中转速度1.41G`
测试[mws, mwss, mtls] + [relay]协议
同样方式测速:
得到测速结果`relay+mws协议中转速度1.39G`
得到测速结果`relay+mwss协议中转速度1.1G`
得到测速结果`relay+mtls协议中转速度1.34G`
muran
Tommy
kac
acs12
kaka
yimiao
jue111
ddddd
makabaka
mars
qtest
Jack
iwil
凤凰股份的
muran2
666
jawer
jwd
1268
山海
Tommys
tina
abc
撒范德萨分
linda
是多少
qwez
emmm
shabixianzhi
66666
lyglay1991
hqm
ccmuran
fvh
aaa
嗷嗷
wang
21sad
Goo
小熊维尼
maru
r
merlynr
baka
ipbuser
jhihihi
Eduarte
eiwonttw
fee
sepmeocat
niggurath
xxx
21sad
看看
locet
test
socos
TTTT
Dskrrrr
das
lev
lev
666
Alibabaa
嗷嗷
Ray
Ray
Tommy
eweasdf
李淳罡
Tommy
kk
kk
sun
87987
1
xxx
luke
LYCX2015
爸爸
tsxb
jatwu
RobinSome
dva
dvawef
1
Tommy
ccmuran
1245
eyeliding1111
sunshin
feng
wyk
jerry
leo
leo
ddrmoo
Jennifer
XX
asdfasdf
asdfasdf
mars
看看
渡鸦
ehco