shadowsocks-rust
                                
                                 shadowsocks-rust copied to clipboard
                                
                                    shadowsocks-rust copied to clipboard
                            
                            
                            
                        UDP package limit on ssmanager
The manager communication to ssmanager is done via UDP. This is blazing fast, but it seems that the current implementation can only transfer at maximum 65kb network packets. This leads to infinite waits on client sides or other unwanted behaivor.
How to reproduce
- 
start ssmanager: ssmanager --manager-address 127.0.0.1:1111
- 
start a lot of port listeners: for x in {10000..15000}; do echo 'add: {"server_port": '$x', "password": "passwordpasswordpasswordpasswordpasswordpassword"}'; done | nc -u localhost 1111
- 
issue a listcommand:echo 'list' | nc -u localhost 1111
You'll see that nc is receiving only a part of the full data.
A UDP datagram is carried in a single IP packet and is hence limited to a maximum payload of 65,507 bytes for IPv4 and 65,527 bytes for IPv6.
So it is the limitation of UDP.
We can send more than 1 package, this is how UDP is usually used. The terminating character is \n in the ss api, so there shouldn't be any issues.
start a lot of port listeners
I don't think starting thousands of listeners is how you are supposed to use the server. You might want to use Shadowsocks 2022's multi-user mode to add multiple uPSKs to a single port.
but it seems that the current implementation can only transfer at maximum 65kb network packets.
What about using a unix domain socket instead?
The current API is terrible, but we don't have anything better to replace it yet.
We can send more than 1 package, this is how UDP is usually used. The terminating character is \n in the ss api, so there shouldn't be any issues.
How can you ensure that UDP packets arrive to your client in order?
@zonyitoo You can't, you have to write this logic yourself. That's why TCP was created.
@database64128 I'll test the multi-user model via uPSK. Thanks for the hint.
@database64128 With AEAD-2022, is it possible to add and remove users while the server is running?
It is possible, but the current interface have to remove then readd the server.
The current ssmanager interface is quite bad for managing lots of users. A new user management interface is required.
I have proposed a new management API for Shadowsocks servers and implemented it in shadowsocks-go.
Shadowsocks-NET/shadowsocks-specs#3