angt / glorytun

Multipath UDP tunnel
BSD 2-Clause "Simplified" License
683 stars 105 forks source link

latest glorytun bench is too low! #55

Closed hewenhao2008 closed 4 years ago

hewenhao2008 commented 4 years ago

I use port latest glorytun to openwrt for Qualcomm IPQ4029 CPU (quad core 800Mhz), but I compile it with error ' GCC have no attribute target("+crypto")'. My GCC version is 7.4.0, and IPQ4029 is arm v7 CPU with neon-vfpv4 feature. So I comment #pragma GCC target("+crypto") in the mud/aegis256/aegis256.c as below"

ifdef clang

pragma clang attribute push (attribute((target("crypto"))),apply_to=function)

ifndef __ARM_FEATURE_CRYPTO

define __ARM_FEATURE_CRYPTO 1

endif

//#else //#pragma GCC target("+crypto")

endif

Then compile success, below is the result of the bench test. Openwrt:/root# glorytun-udp bench cipher: chacha20poly1305

size min mean max

20        13 Mbps        13 Mbps        13 Mbps

150 57 Mbps 57 Mbps 57 Mbps 280 75 Mbps 77 Mbps 77 Mbps 410 86 Mbps 87 Mbps 87 Mbps 540 93 Mbps 94 Mbps 94 Mbps 670 97 Mbps 98 Mbps 98 Mbps 800 101 Mbps 101 Mbps 102 Mbps 930 103 Mbps 103 Mbps 104 Mbps 1060 105 Mbps 105 Mbps 106 Mbps 1190 106 Mbps 107 Mbps 107 Mbps 1320 108 Mbps 109 Mbps 109 Mbps 1450 109 Mbps 110 Mbps 110 Mbps

I think the speed is too low, Is there any way to disable the encryption for me. In fact I don't need encryption but speed is important for me. By the way IPQ4029 have a hardware crypto engine, but I don't know how to use it

bmullan commented 4 years ago

The attached research white paper uses different performance tests but shows results from Openvpn, TINC, SoftEther, Wireguard, Zerotier.

All with Encryption enabled. All of those are very much higher performance than from your results ?

Perhaps your testing methodology had a problem as I would think GloryTun would produce better performance also.

Brian

On Sun, Dec 8, 2019, 7:13 AM hewenhao2008 notifications@github.com wrote:

I use port latest glorytun to openwrt for Qualcomm IPQ4029 CPU (quad core 800Mhz), but I compile it with error ' GCC have no attribute target("+crypto")'. My GCC version is 7.4.0, and IPQ4029 is arm v7 CPU with neon-vfpv4 feature. So I comment #pragma GCC target("+crypto") in the mud/aegis256/aegis256.c as below"

ifdef clang

pragma clang attribute push (attribute

((target("crypto"))),apply_to=function)

ifndef __ARM_FEATURE_CRYPTO

define __ARM_FEATURE_CRYPTO 1

endif

//#else //#pragma GCC target("+crypto")

endif

Then compile success, below is the result of the bench test. Openwrt:/root# glorytun-udp bench cipher: chacha20poly1305 size min mean max

20 13 Mbps 13 Mbps 13 Mbps

150 57 Mbps 57 Mbps 57 Mbps 280 75 Mbps 77 Mbps 77 Mbps 410 86 Mbps 87 Mbps 87 Mbps 540 93 Mbps 94 Mbps 94 Mbps 670 97 Mbps 98 Mbps 98 Mbps 800 101 Mbps 101 Mbps 102 Mbps 930 103 Mbps 103 Mbps 104 Mbps 1060 105 Mbps 105 Mbps 106 Mbps 1190 106 Mbps 107 Mbps 107 Mbps 1320 108 Mbps 109 Mbps 109 Mbps 1450 109 Mbps 110 Mbps 110 Mbps

I think the speed is too low, Is there any way to disable the encryption for me. In fact I don't need encryption but speed is important for me. By the way IPQ4029 have a hardware crypto engine, but I don't know how to use it

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/angt/glorytun/issues/55?email_source=notifications&email_token=AAM23J3FQ2E5MJ5JSFVMUF3QXTQHTA5CNFSM4JX3ASIKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H64KMSA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM23JYSXTDFQ3TP5XL2AJLQXTQHTANCNFSM4JX3ASIA .

hewenhao2008 commented 4 years ago

@bmullan I just run glorytun bench command for my testing. I don't know if I comment #pragma GCC target("+crypto") in aegis256.c cause the slow result. But can't compile without the comment. And I think IPQ4029 CPU should not get a so low speed. By the way where is the white paper, i didn't find your attached file.

angt commented 4 years ago

Hi, I didn't have the time to check compilations with old versions of GCC. I guess gcc 7.x is too old... In your case you have to specify the correct CFLAGS like this (it's an example):

$ make CFLAGS="-march=armv8-a -mfpu=crypto-neon-fp-armv8"

You can check if yours march/mfpu options have a chance to work by checking the presence of __ARM_FEATURE_CRYPTO like this:

$ gcc -march=armv8-a -mfpu=crypto-neon-fp-armv8 -dM -E -c - </dev/null | grep CRYPTO
#define __ARM_FEATURE_CRYPTO 1

The best should be to use a recent version of GCC.

hewenhao2008 commented 4 years ago

@angt Thank you for your reply. My CPU is armv7 not armv8, so I think it will not support __ARM_FEATURE_CRYPTO. I use "TARGET_CFLAGS += -march=armv7-a -mfloat-abi=hard -mfpu=neon-vfpv4" but the result is still the same. Any thing can I do on armv7?

angt commented 4 years ago

Following https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html the +crypto extension is only available on armv8.

angt commented 4 years ago

I'm closing this issue as I'm not going to work on armv7 optimization soon.

bmullan commented 4 years ago

@hewenhao2008 Here is the URL to the Univ of Gent White Paper results of VPN tests https://biblio.ugent.be/publication/8634434/file/8634506.pdf

@bmullan I just run glorytun bench command for my testing. I don't know if I comment #pragma GCC target("+crypto") in aegis256.c cause the slow result. But can't compile without the comment. And I think IPQ4029 CPU should not get a so low speed. By the way where is the white paper, i didn't find your attached file.

anton000 commented 4 years ago

@bmullan seems paper no longer accessible to ip outside Ugent?

Per chance, is this same paper? http://dl.ifip.org/db/conf/cnsm/cnsm2019/1570561814.pdf

bmullan commented 3 years ago

@anton000 Yes... that is the same Paper

Per chance, is this same paper? http://dl.ifip.org/db/conf/cnsm/cnsm2019/1570561814.pdf