几种网络隧道的性能简单测试(使用iPerf3)

TLDR

隧道协议 IpIp IpSit UDP
带宽(MB/s) 1305 1288 1289 1259

在一种工作负载下,进行简单测试,IpIp与IpSit性能相当,UDP稍差。

测试服务器信息

测试Server服务器:172.31.183.57

测试Client服务器:172.31.183.58

网络掩码:255.255.240.0

无隧道

# server
iperf3 -s -f K
# client
iperf3 -c $IP -f M

server侧观测

image-20211108134409817

client侧观测

image-20211108134426730

ipip隧道

# 开启ipip隧道
modprobe ipip

# server
ip tunnel add ipip_tunnel mode ipip local 172.31.183.57 remote 172.31.183.58 ttl 32
ip link set ipip_tunnel up
sysctl -w net.ipv4.conf.all.rp_filter=0
sysctl -w net.ipv4.conf.ipip_tunnel.rp_filter=0

ip addr add 172.31.183.59/32 dev ipip_tunnel
ip route add 172.31.183.60 dev ipip_tunnel

# client
ip tunnel add ipip_tunnel mode ipip local 172.31.183.58 remote 172.31.183.57 ttl 32
ip link set ipip_tunnel up
sysctl -w net.ipv4.conf.all.rp_filter=0
sysctl -w net.ipv4.conf.ipip_tunnel.rp_filter=0
ip addr add 172.31.183.60/32 dev ipip_tunnel
ip route add 172.31.183.59 dev ipip_tunnel

clean

# server
ip route del 172.31.183.60 dev ipip_tunnel
ip addr del 172.31.183.59/32 dev ipip_tunnel
ip link del ipip_tunnel
# client
ip route del 172.31.183.59 dev ipip_tunnel
ip addr del 172.31.183.60/32 dev ipip_tunnel
ip link del ipip_tunnel

server侧观测

[图片上传失败...(image-1b31e8-1636362323224)]

client侧观测

image-20211108155832282

ipSet隧道

# server
ip link add name sit_tunnel type sit local 172.31.183.57 remote 172.31.183.58 mode any
ip link set sit_tunnel up
sysctl -w net.ipv4.conf.all.rp_filter=0
sysctl -w net.ipv4.conf.sit_tunnel.rp_filter=0
ip addr add 172.31.183.59/32 dev sit_tunnel
ip route add 172.31.183.60 dev sit_tunnel

# client
ip link add name sit_tunnel type sit local 172.31.183.58 remote 172.31.183.57 mode any
ip link set sit_tunnel up
sysctl -w net.ipv4.conf.all.rp_filter=0
sysctl -w net.ipv4.conf.sit_tunnel.rp_filter=0
ip addr add 172.31.183.60/32 dev sit_tunnel
ip route add 172.31.183.59 dev sit_tunnel

clean

# server
ip route del 172.31.183.60 dev sit_tunnel
ip addr del 172.31.183.59/32 dev sit_tunnel
ip link del sit_tunnel
# client
ip route del 172.31.183.59 dev sit_tunnel
ip addr del 172.31.183.60/32 dev sit_tunnel
ip link del sit_tunnel

server侧观测

[图片上传失败...(image-ba0d03-1636362323224)]

client侧观测

image-20211108162601731

UDP隧道

# server
ip link add vxlan_tunnel type vxlan id 42 dstport 4789 local 172.31.183.57 remote 172.31.183.58 dev eth0
ip link set vxlan_tunnel up
sysctl -w net.ipv4.conf.all.rp_filter=0
sysctl -w net.ipv4.conf.vxlan_tunnel.rp_filter=0
ip addr add 172.31.183.59/32 dev vxlan_tunnel
ip route add 172.31.183.60 dev vxlan_tunnel

# client
ip link add vxlan_tunnel type vxlan id 42 dstport 4789 local 172.31.183.58 remote 172.31.183.57 dev eth0
ip link set vxlan_tunnel up
sysctl -w net.ipv4.conf.all.rp_filter=0
sysctl -w net.ipv4.conf.vxlan_tunnel.rp_filter=0
ip addr add 172.31.183.60/32 dev vxlan_tunnel
ip route add 172.31.183.59 dev vxlan_tunnel

clean

# server
ip route del 172.31.183.60 dev vxlan_tunnel
ip addr del 172.31.183.59/32 dev vxlan_tunnel
ip link del vxlan_tunnel
# client
ip route del 172.31.183.59 dev vxlan_tunnel
ip addr del 172.31.183.60/32 dev vxlan_tunnel
ip link del vxlan_tunnel

server侧观测

[图片上传失败...(image-410f77-1636362323224)]

client侧观测

image-20211108164002053
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容