关闭网卡合包特性, udp2raw 依然报警

2023-02-20 13:02:21 +08:00
 hanssx

客户端与服务端以 udp2raw+wg 的方式互联,服务端为公网 IPv4 ,udp2raw 客户端报警信息如下,报警触发主要是在最开始远程 rdp 内网主机的时候

[2023-02-20 12:35:39][WARN]huge packet,data len=1452 (>=1375).strongly suggested to set a smaller mtu at upper level,to get rid of this warn
 [2023-02-20 12:35:39][WARN]pcap_sendpcaket failed with vaule -1,send error: PacketSendPacket failed, data_len=1558
[2023-02-20 12:35:39][WARN]huge packet,data len=1452 (>=1375).strongly suggested to set a smaller mtu at upper level,to get rid of this warn
 [2023-02-20 12:35:39][WARN]pcap_sendpcaket failed with vaule -1,send error: PacketSendPacket failed, data_len=1558
[2023-02-20 12:35:39][WARN]huge packet,data len=1452 (>=1375).strongly suggested to set a smaller mtu at upper level,to get rid of this warn
 [2023-02-20 12:35:39][WARN]pcap_sendpcaket failed with vaule -1,send error: PacketSendPacket failed, data_len=1558

应该是 MTU 的问题,服务端是 2 台不同的设备,服务端设置的都是 1280 的 MTU ,除去刷 openwrt 的硬件不同,其他均一致,比如客户端和服务端都加了--fix-gro 参数,用来修复 GRO 特性导致的 MTU 过大问题。


2 台设备分别是:

一台设备用红米 AX6 刷的 openwrt 作为主路由,这个无问题,这台即使开着 GRO 等网卡合并特性,依然不会报警。

一台是 PVE 虚拟直通的 I350 网卡刷的 openwrt 作为旁路由,端口映射到主路由,这台会在初始 rdp 内网主机的时候报警。

2 台 openwrt 网卡信息的主要区别在于 PVE 虚拟机多出 3 个 on 的选项,如下,

tx-udp_tnl-csum-segmentation: off [fixed]
tx-gso-partial: off [fixed]
tx-tunnel-remcsum-segmentation: off [fixed]
tx-sctp-segmentation: on
tx-esp-segmentation: off [fixed]
tx-udp-segmentation: on
tx-gso-list: on

其中 tx-gso-list: on ,我尝试用ethtool -K wg0 gso off关闭不掉,这 3 个 on 从字面看像是分段的,udp2raw 告警和这 3 个 on 有关系吗?


附加 2 台网卡的完整信息

其中 PVE 虚拟机关掉了 GRO LRO GSO TSO ,红米 AX6 没有关掉(刚开始是关掉的,后面重启之后会重新 on ,但是可能加了--fix-gro 参数的缘故,红米 AX6 一直没有问题。) 红米 AX6:

Features for wg0:
rx-checksumming: on
tx-checksumming: on
	tx-checksum-ipv4: off [fixed]
	tx-checksum-ip-generic: on
	tx-checksum-ipv6: off [fixed]
	tx-checksum-fcoe-crc: off [fixed]
	tx-checksum-sctp: off [fixed]
scatter-gather: on
	tx-scatter-gather: on
	tx-scatter-gather-fraglist: off [fixed]
tcp-segmentation-offload: on
	tx-tcp-segmentation: on
	tx-tcp-ecn-segmentation: on
	tx-tcp6-segmentation: on
udp-fragmentation-offload: on
generic-segmentation-offload: on
generic-receive-offload: on
large-receive-offload: off [fixed]
rx-vlan-offload: off [fixed]
tx-vlan-offload: off [fixed]
ntuple-filters: off [fixed]
receive-hashing: off [fixed]
highdma: on
rx-vlan-filter: off [fixed]
vlan-challenged: off [fixed]
tx-lockless: on [fixed]
netns-local: off [fixed]
tx-gso-robust: off [fixed]
tx-fcoe-segmentation: off [fixed]
tx-gre-segmentation: off [fixed]
tx-ipip-segmentation: off [fixed]
tx-sit-segmentation: off [fixed]
tx-udp_tnl-segmentation: off [fixed]
fcoe-mtu: off [fixed]
tx-nocache-copy: off
loopback: off [fixed]
rx-fcs: off [fixed]
rx-all: off [fixed]
tx-vlan-stag-hw-insert: off [fixed]
rx-vlan-stag-hw-parse: off [fixed]
rx-vlan-stag-filter: off [fixed]
l2-fwd-offload: off [fixed]
busy-poll: off [fixed]
rx-gro-hw: off [fixed]

PVE 虚拟机:

root@OpenWrt:~# ethtool --show-offload wg0
Features for wg0:
rx-checksumming: on
tx-checksumming: on
	tx-checksum-ipv4: off [fixed]
	tx-checksum-ip-generic: on
	tx-checksum-ipv6: off [fixed]
	tx-checksum-fcoe-crc: off [fixed]
	tx-checksum-sctp: off [fixed]
scatter-gather: on
	tx-scatter-gather: on
	tx-scatter-gather-fraglist: off [fixed]
tcp-segmentation-offload: off
	tx-tcp-segmentation: off
	tx-tcp-ecn-segmentation: off
	tx-tcp-mangleid-segmentation: off
	tx-tcp6-segmentation: off
generic-segmentation-offload: off
generic-receive-offload: off
large-receive-offload: off [fixed]
rx-vlan-offload: off [fixed]
tx-vlan-offload: off [fixed]
ntuple-filters: off [fixed]
receive-hashing: off [fixed]
highdma: on
rx-vlan-filter: off [fixed]
vlan-challenged: off [fixed]
tx-lockless: on [fixed]
netns-local: off [fixed]
tx-gso-robust: off [fixed]
tx-fcoe-segmentation: off [fixed]
tx-gre-segmentation: off [fixed]
tx-gre-csum-segmentation: off [fixed]
tx-ipxip4-segmentation: off [fixed]
tx-ipxip6-segmentation: off [fixed]
tx-udp_tnl-segmentation: off [fixed]
tx-udp_tnl-csum-segmentation: off [fixed]
tx-gso-partial: off [fixed]
tx-tunnel-remcsum-segmentation: off [fixed]
tx-sctp-segmentation: on
tx-esp-segmentation: off [fixed]
tx-udp-segmentation: on
tx-gso-list: on
fcoe-mtu: off [fixed]
tx-nocache-copy: off
loopback: off [fixed]
rx-fcs: off [fixed]
rx-all: off [fixed]
tx-vlan-stag-hw-insert: off [fixed]
rx-vlan-stag-hw-parse: off [fixed]
rx-vlan-stag-filter: off [fixed]
l2-fwd-offload: off [fixed]
hw-tc-offload: off [fixed]
esp-hw-offload: off [fixed]
esp-tx-csum-hw-offload: off [fixed]
rx-udp_tunnel-port-offload: off [fixed]
tls-hw-tx-offload: off [fixed]
tls-hw-rx-offload: off [fixed]
rx-gro-hw: off [fixed]
tls-hw-record: off [fixed]
rx-gro-list: off
macsec-hw-offload: off [fixed]
rx-udp-gro-forwarding: off
hsr-tag-ins-offload: off [fixed]
hsr-tag-rm-offload: off [fixed]
hsr-fwd-offload: off [fixed]
hsr-dup-offload: off [fixed]
1569 次点击
所在节点    宽带症候群
3 条回复
tavimori
2023-02-20 16:40:43 +08:00
有没有在客户端 wg 限制 MTU ?客户端、服务端的 wg 都需要设置 MTU 。
hanssx
2023-02-20 18:15:07 +08:00
@tavimori 感谢老哥,客户端加上 MTU=1280 之后,客户端没报警了,不过 PVE 虚拟机实际使用效果与红米 AX6 还是有区别,PVE 虚拟机刚开始 RDP 上需要等一段时间,RDP 的信号质量会从 1 格上升到满格,RDP 上面给的提示也不一样。
AX6:与远程计算机连接的质量非常好,并且已经启用了 UDP 。
PVE 虚拟机:与远程计算机连接的质量非常好
tavimori
2023-02-20 20:07:44 +08:00
@hanssx 你的描述主要是从应用上讲的,比较难定位具体的问题。
不过我猜测可能是因为你的 MTU 限制是在 wg 链路上,而你的客户端、服务端中至少有一个并不直接是 wg 节点。这种场景下需要在 wg 节点上对过路的 TCP 连接进行 MSS 钳制,否则可能会导致 IP 分片,产生类似你提到的性能问题。
你可以了解下 MSS 钳制的原理,应该就是在你的 wg 路由器上增加一两条防火墙规则。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/917581

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX