xtaci / kcptun

A Quantum-Safe Secure Tunnel based on QPP, KCP, FEC, and N:M multiplexing.
MIT License
13.92k stars 2.54k forks source link

Support ARM64 #528

Closed odkrys closed 7 years ago

odkrys commented 7 years ago

Could you add GOARCH=arm64 build for ARMv8 ?

xtaci commented 7 years ago

what kind of device are you using ?

odkrys commented 7 years ago

RT-AC86U. Weird, I knew that RT-AC86U's userspace still runs on armv7 so I tested kcptun yesterday and it was stucked at error. But today, it works WTH. The armv7 version works fine.

Will the aarch64 version have better efficiency than armv7?

xtaci commented 7 years ago

arm64 is intended for desktop & server,and it's not the main stream processor at the moment, i don't think it's necessary to compile for that platform until it becomes epidemic.

but, after all, it's easy for you to compile for yourself. just take a look the the build-release.sh

odkrys commented 7 years ago

FYI, arm64 + golang aes patch make noticeable improvement. On RT-AC86U, when youtube speed around 45000~50000Kbps with aes encryption.

armv7 version cpu usage is 150% of 200% (2 cores) normal arm64 version cpu usage is same with armv7.

arm64 + aes patch version cpu usage is 100% of 200%. AES performance is similar with XOR :D.

https://go-review.googlesource.com/c/go/+/64490

xtaci commented 7 years ago

@odkrys do you know the market share of arm64 routers? it's important for decision

odkrys commented 7 years ago

Well, no one knows the exact number. It just beginning. Here are the lists of broadcom cortex-a53 router. https://goo.gl/pYAYwG https://goo.gl/pM3Nmt

and number of RT-AC86U merlin beta firmware downloader.

https://www.mediafire.com/folder/bkfq2a6aebq68/Asuswrt-Merlin#vcl7bwm99phlc

xtaci commented 7 years ago

@odkrys @jannson should I support ARM64 in the next release?

odkrys commented 7 years ago

It would be good for pi 3 users also.

odkrys commented 7 years ago

Here is the number. On my RT-AC86U client / server

ARMv7 (prebuild)

none = 296 / 291 (Mbits/sec)
xor = 282 / 277
salsa20 = 272 / 266
aes-128 = 244 / 240
aes-192 = 239 / 235
aes-256 = 233 / 229

ARM64 (mybuild)

none = 432 / 432
xor = 420 / 409
salsa20 = 381 / 375
aes-128 = 403 / 397
aes-192 = 403 / 397
aes-256 = 400 / 395

I used this script.

#!/bin/bash

number=327680000
method=aes-256

client_linux_arm7 --key test --crypt $method -l 127.0.0.1:8388 -r 127.0.0.1:8389 --mode fast2 --mtu 1350 --sndwnd 8192 --rcvwnd 8192 --quiet true &
server_linux_arm7 --key test --crypt $method -l 127.0.0.1:8389 -t 127.0.0.1:8390 --mode fast2 --mtu 1350 --sndwnd 8192 --rcvwnd 8192 --quiet true &

iperf -s -p 8390 &

sleep 1

iperf -c 127.0.0.1 -p 8388 -n $number

killall client_linux_arm7
killall server_linux_arm7
killall iperf

sleep 1
echo "Test Finished"
huangya90 commented 6 years ago

Even though this issue was closed. Still hope can release ARM64 version.