Closed half2me closed 11 months ago
I've tried to send 1501
bytes of payload, and that fails the same. It seems like 1500
is the hard limit for UDP payload.
Update, I've found the UDPPacketSize
parameter that is configurable. If I increase this, it works. Maybe this could be added to the documentation?
Update, I've found the
UDPPacketSize
parameter that is configurable. If I increase this, it works. Maybe this could be added to the documentation?
https://gofrp.org/zh-cn/docs/reference/client-configures/#clientcommonconfig
https://github.com/fatedier/frp#configuration-files
@half2me It is difficult for us to describe the configuration of all functions one by one. Here, it is mentioned that you can find more capabilities in the full example configuration that are not mentioned in the documentation.
@fatedier Yes, I understand. But I spent at least a few hours debugging this issue yesterday thinking it was something wrong in my application. I didn't expect frp to be modifying my data as a "default" behaviour. Is there any reason that the max udp packet size is set to 1500 instead of a higher value? What is the purpose of limiting it? Is it for memory saving?
@fatedier Yes, I understand. But I spent at least a few hours debugging this issue yesterday thinking it was something wrong in my application. I didn't expect frp to be modifying my data as a "default" behaviour. Is there any reason that the max udp packet size is set to 1500 instead of a higher value? What is the purpose of limiting it? Is it for memory saving?
1500 是标准的 以太网 MTU 值
Bug Description
When proxying UDP packets over 1500 bytes, only the first 1500 bytes of the payload are received, the rest is lost. This behaviour seems to be the same regardless of the protocol used to connect to frps. I've tried
tcp
,quic
andkcp
, they all produce the same result.frpc Version
0.52.3
frps Version
0.52.3
System Architecture
server: linux_arm64, client: darwin_arm64
Configurations
Server:
Client:
Logs
No response
Steps to reproduce
bufferSize = 65535 UDPServerSocket = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM) UDPServerSocket.bind(("127.0.0.1", 5060))
while True: bytesAddressPair = UDPServerSocket.recvfrom(bufferSize) print("Got {} bytes from client".format(len(bytesAddressPair[0])))
The server console should show:
Got 5000 bytes from client
Now send the same UDP packet over frp. Start frpc, and rerun the script, but change the
IPADDR
from127.0.0.1
to the public IP where frps is listening.The console of the python server now shows:
Got 1500 bytes from client
This is the wrong size, as its only the first part of the packet.Affected area