shadowsocks-rust icon indicating copy to clipboard operation
shadowsocks-rust copied to clipboard

UDP package failed to send back from the ssserver

Open jackli0127 opened this issue 1 year ago • 4 comments

image

shadowsocks-rust verison: v.1.17.1 OS version: Centos 9 Stream or Ubuntu 20.4

We upgraded our Shadowsocks from shadowsocks-libev 3.3.4 on CentOS 7 to shadowsocks-rust 1.17.1 on CentOS Stream 9 and Ubuntu 20.4, and then I found a large number of errors in the ssserver log as attached, which resulted in the loss of video during our users' Zoom meeting.

If I deploy shadowsocks-libev 3.3.5 on CentOS Stream 9 or Ubuntu 20.04, the same error messages are found. However, if I deploy shadowsocks-libev 3.3.4, both the log messages and our meeting video return to normal.

Any ideas on how to resolve the problem? Thanks!

jackli0127 avatar Jan 13 '24 18:01 jackli0127

It seems like an MTU misconfiguration somewhere in your network. You didn't discover the issue with shadowsocks-libev because it didn't bother with disabling IP fragmentation.

database64128 avatar Jan 13 '24 20:01 database64128

However, even when I configure a smaller MTU value on the network interface or in the ss-server parameters (shadowsocks-libev 3.3.5), I still encounter this error message.

The error only occurs when using the UDP protocol, and even UDP packets of 500 bytes fail to send

jackli0127 avatar Jan 14 '24 09:01 jackli0127

EMSGSIZE should only occurs when packet size is greater than MTU. But interestingly that those ~500 bytes packets still fails.

The error was reported here:

https://github.com/shadowsocks/shadowsocks-rust/blob/1789dfad781966464fc7b4aef9ca470128f1526b/crates/shadowsocks-service/src/server/udprelay.rs#L791-L797

And you may also try to comment these lines and see if EMSGSIZE goes away:

https://github.com/shadowsocks/shadowsocks-rust/blob/1789dfad781966464fc7b4aef9ca470128f1526b/crates/shadowsocks/src/net/sys/unix/mod.rs#L55-L57

zonyitoo avatar Jan 20 '24 14:01 zonyitoo

I've also encountered this error, but it doesn't seem to have much impact

2024-03-26T17:14:38.953329076+08:00  WARN tokio-runtime-worker ThreadId(02) shadowsocks_service::server::udprelay: udp failed to send back 1455 bytes to client [::ffff:223.*.*.*]:6753, from target 122.10.255.159:8130, error: Message too long (os error 90)
2024-03-26T17:18:19.833890636+08:00  WARN tokio-runtime-worker ThreadId(03) shadowsocks_service::server::udprelay: udp failed to send back 1455 bytes to client [::ffff:223.*.*.*]:14735, from target 122.10.255.159:8130, error: Message too long (os error 90)
2024-03-26T17:19:53.901777502+08:00  WARN tokio-runtime-worker ThreadId(03) shadowsocks_service::server::udprelay: udp failed to send back 1455 bytes to client [::ffff:223.*.*.*]:14735, from target 122.10.255.159:8130, error: Message too long (os error 90)

nasaboy avatar Mar 26 '24 15:03 nasaboy