[GH-ISSUE #1487] UDP连接无法发送大于2K字节的帧,无法穿透 #1173

Closed
opened 2026-05-05 12:45:12 -06:00 by gitea-mirror · 6 comments
Owner

Originally created by @squarerlee on GitHub (Oct 29, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1487

Originally assigned to: @blizard863 on GitHub.

What version of frp are you using (./frpc -v or ./frps -v)?
服务器 0.29.0 的AMD64
客户端 0.29.0 的arm
What operating system and processor architecture are you using (go env)?
服务端操作系统:Windows Server 2008 R2 Enterprice
客户端操作系统:海思Hi3536平台的定制linux arm A17的CPU
Configures you used:
客服端配置如下:
[common]
server_addr = 123.123.123.123
server_port = 7000
token = xxxxxxxxxx
log_level = info
log_file = frpc.log
log_max_days = 7
login_fail_exit = false
protocol = tcp
tcp_mux = true

[3702]
type = udp
local_ip = 127.0.0.1
local_port = 3702
remote_port = 3702
use_compression = true
use_encryption = true

Steps to reproduce the issue:
1.服务端运行,客户端运行
2.使用另一内网的PC往服务端IP的3702端口发送数据,帧数据大小2Kbytes

Describe the results you received:
数据无法发送到客户端的对应端口,小些的包则正常收到,实际边界不一定是1518字节,未具体测试
客户端log报错内容:[W] [proxy.go:438] [3702] read from workConn for udp error: EOF
报错以后,必须重启客户端,不然小包的收发也不通

Describe the results you expected:
2Kbytes的帧,UTP正常收发数据

Additional information you deem important (e.g. issue happens only occasionally):

Can you point out what caused this issue (optional)
每次发送巨帧都会出现,是帧缓存设置大小过小?

Originally created by @squarerlee on GitHub (Oct 29, 2019). Original GitHub issue: https://github.com/fatedier/frp/issues/1487 Originally assigned to: @blizard863 on GitHub. **What version of frp are you using (./frpc -v or ./frps -v)?** 服务器 0.29.0 的AMD64 客户端 0.29.0 的arm **What operating system and processor architecture are you using (`go env`)?** 服务端操作系统:Windows Server 2008 R2 Enterprice 客户端操作系统:海思Hi3536平台的定制linux arm A17的CPU **Configures you used:** 客服端配置如下: [common] server_addr = 123.123.123.123 server_port = 7000 token = xxxxxxxxxx log_level = info log_file = frpc.log log_max_days = 7 login_fail_exit = false protocol = tcp tcp_mux = true [3702] type = udp local_ip = 127.0.0.1 local_port = 3702 remote_port = 3702 use_compression = true use_encryption = true **Steps to reproduce the issue:** 1.服务端运行,客户端运行 2.使用另一内网的PC往服务端IP的3702端口发送数据,帧数据大小2Kbytes **Describe the results you received:** 数据无法发送到客户端的对应端口,小些的包则正常收到,实际边界不一定是1518字节,未具体测试 客户端log报错内容:[W] [proxy.go:438] [3702] read from workConn for udp error: EOF 报错以后,必须重启客户端,不然小包的收发也不通 **Describe the results you expected:** 2Kbytes的帧,UTP正常收发数据 **Additional information you deem important (e.g. issue happens only occasionally):** **Can you point out what caused this issue (optional)** 每次发送巨帧都会出现,是帧缓存设置大小过小?
gitea-mirror 2026-05-05 12:45:12 -06:00
Author
Owner

@fatedier commented on GitHub (Oct 29, 2019):

目前内部写死的 buffer 大小是 1500,所以超过这个值的 UDP 包会无法收到,可以先手动修改代码中这个值,重新编译后测试下是否可以。

后续会改成可配置。

<!-- gh-comment-id:547336424 --> @fatedier commented on GitHub (Oct 29, 2019): 目前内部写死的 buffer 大小是 1500,所以超过这个值的 UDP 包会无法收到,可以先手动修改代码中这个值,重新编译后测试下是否可以。 后续会改成可配置。
Author
Owner

@squarerlee commented on GitHub (Oct 29, 2019):

好的,谢谢

<!-- gh-comment-id:547339138 --> @squarerlee commented on GitHub (Oct 29, 2019): 好的,谢谢
Author
Owner

@hzexe commented on GitHub (Dec 2, 2019):

意义也不大吧,大包总会被你无法控制的网络设备丢弃掉。

<!-- gh-comment-id:560327292 --> @hzexe commented on GitHub (Dec 2, 2019): 意义也不大吧,大包总会被你无法控制的网络设备丢弃掉。
Author
Owner

@QQ2017 commented on GitHub (Dec 16, 2019):

MTU太大也不好的

<!-- gh-comment-id:565911418 --> @QQ2017 commented on GitHub (Dec 16, 2019): MTU太大也不好的
Author
Owner

@feng-yifan commented on GitHub (Mar 16, 2020):

可以配置的还是好,我现在也遇到这个情况了,可能用到UDP穿透的比较少吧

<!-- gh-comment-id:599619997 --> @feng-yifan commented on GitHub (Mar 16, 2020): 可以配置的还是好,我现在也遇到这个情况了,可能用到UDP穿透的比较少吧
Author
Owner

@feng-yifan commented on GitHub (Jun 17, 2020):

完结撒花,快打release!

<!-- gh-comment-id:645545113 --> @feng-yifan commented on GitHub (Jun 17, 2020): 完结撒花,快打release!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#1173
No description provided.