SagerNet / sing-box

The universal proxy platform
https://sing-box.sagernet.org/
Other
19.34k stars 2.3k forks source link

Version 1.3之后的DNS over QUIC似乎存在问题 #719

Closed mzwing closed 1 year ago

mzwing commented 1 year ago

Welcome

Description of the problem

sing-box Version 1.3之后的DNS over QUIC似乎存在问题,速度比1.2.7慢很多,并且https站点都受影响。

影响具体表现为:开启了HSTS的网站无法访问,部分以https连接的网站会先跳转到http再跳转回https(如下文的baidu),部分以https连接的网站会先跳转为http然后显示连接已重置错误(如下文的qq)

测试所用网站为https://www.baidu.comhttps://www.qq.com,浏览器为Microsoft Edge 114.0.1823.82,系统为Windows 11

同样配置在sing-box 1.2.7中无问题

Version of sing-box

```console $ sing-box version # Paste output here sing-box version unknown Environment: go1.20.6 windows/amd64 Tags: with_quic,with_grpc,with_dhcp,with_wireguard,with_shadowsocksr,with_ech,with_utls,with_reality_server,with_acme,with_clash_api,with_v2ray_api,with_gvisor CGO: enabled ```

Server and client configuration file

```console # paste json here { "log": { "level": "trace", "output": "box.log" }, "dns": { "servers": [ { "tag": "adguard", "address": "quic://94.140.14.140", "detour": "direct" } ] }, "inbounds": [ { "type": "tun", "tag": "tun-in", "interface_name": "sing-box-tun", "inet4_address": "172.19.0.1/28", "inet6_address": "fdfe:dcbc:1515::1/126", "auto_route": true, "stack": "system", "sniff": true } ], "outbounds": [ { "type": "direct", "tag": "direct" }, { "type": "dns", "tag": "dns-out" } ], "route": { "geoip": { "path": "./resources/geoip.db" }, "geosite": { "path": "./resources/geosite.db" }, "rules": [ { "protocol": "dns", "outbound": "dns-out" } ], "final": "direct", "auto_detect_interface": true } } ```

Server and client log file

```console # paste log here # 太长了,浏览器Out of memory了,因此改用了链接,请谅解 ``` [box-latest-quic.log](https://github.com/SagerNet/sing-box/files/12067837/box-latest-quic.log)
mzwing commented 1 year ago

使用latest commit,但将adguard public dns改为以HTTP3连接时无问题

version:

```console sing-box version unknown Environment: go1.20.6 windows/amd64 Tags: with_quic,with_grpc,with_dhcp,with_wireguard,with_shadowsocksr,with_ech,with_utls,with_reality_server,with_acme,with_clash_api,with_v2ray_api,with_gvisor CGO: enabled ```

config:

```console { "log": { "level": "trace", "output": "box.log" }, "dns": { "servers": [ { "tag": "adguard", "address": "h3://94.140.14.140/dns-query", "detour": "direct" } ] }, "inbounds": [ { "type": "tun", "tag": "tun-in", "interface_name": "sing-box-tun", "inet4_address": "172.19.0.1/28", "inet6_address": "fdfe:dcbc:1515::1/126", "auto_route": true, "stack": "system", "sniff": true } ], "outbounds": [ { "type": "direct", "tag": "direct" }, { "type": "dns", "tag": "dns-out" } ], "route": { "geoip": { "path": "./resources/geoip.db" }, "geosite": { "path": "./resources/geosite.db" }, "rules": [ { "protocol": "dns", "outbound": "dns-out" } ], "final": "direct", "auto_detect_interface": true } } ```

log:

[box-latest-h3.log](https://github.com/SagerNet/sing-box/files/12067948/box-latest-h3.log)
mzwing commented 1 year ago

使用1.3.1-beta3,连接方式为DoQ时问题相同

mzwing commented 1 year ago

使用1.2.7,连接方式为DoQ时正常

version:

```console sing-box version 1.2.7 Environment: go1.20.4 windows/amd64 Tags: with_gvisor,with_quic,with_wireguard,with_utls,with_reality_server,with_clash_api Revision: c74d3a53d41b0e8586257a2a1071faf394d1ed2f CGO: disabled ```

config与上面使用quic的一致

log:

[box-1.2.7-quic.log](https://github.com/SagerNet/sing-box/files/12068023/box-1.2.7-quic.log)
nekohasekai commented 1 year ago

日志没有显示问题,如果您的描述属实,则可能是新版 quic-go 存在性能问题,请向他们提出问题。另外,要反馈问题,请提供最小可重现客户端与服务器配置,而不是要求我们提供与商业闭源软件一起使用的支持。

mzwing commented 1 year ago

请提供最小可重现客户端与服务器配置

这确实是最小可重现客户端配置,没有服务器配置(因为并没有用到sing-box服务器)

日志没有显示问题

但是我在box-latest-quic.log中的第81行(之后也还有很多类似的报错)中发现了ERROR,如下:

ERROR dns: exchange failed for www.msftconnecttest.com. IN AAAA: INTERNAL_ERROR (local): tls: either ServerName or InsecureSkipVerify must be specified in the tls.Config

而在使用DoH3时并无此问题。

而不是要求我们提供与商业闭源软件一起使用的支持

~(可是DoQ貌似也就那么几家有)~

已追加测试了iQDNS提供的DoQ服务(quic://8.210.68.247),问题完全相同

则可能是新版 quic-go 存在性能问题,请向他们提出问题

我的疑惑是:DoH3连接使用的应该同样是quic呀,为什么DoH3可以正常使用,DoQ就不行呢(至少在我这里观测如此)?

~(还是说我这个难道是个例)~

感谢您的解答!

maimaiti919 commented 1 year ago

我测试doh没问题,doq同样的错误。我是自建的doh和doq,没有测试doh3。我也是老版本的测试正常的配置文件在最新1.3不可用。前两个月我配置好了测试成功了配置文件就保存着没动过,然后最新的1.3我测试了下就不成功,我以为我配置文件有问题,重新配置了也是同样的上述的

请提供最小可重现客户端与服务器配置

这确实是最小可重现客户端配置,没有服务器配置(因为并没有用到sing-box服务器)

日志没有显示问题

但是我在box-latest-quic.log中的第81行(之后也还有很多类似的报错)中发现了ERROR,如下:

ERROR dns: exchange failed for www.msftconnecttest.com. IN AAAA: INTERNAL_ERROR (local): tls: either ServerName or InsecureSkipVerify must be specified in the tls.Config

而在使用DoH3时并无此问题。

而不是要求我们提供与商业闭源软件一起使用的支持

~(可是DoQ貌似也就那么几家有)~

已追加测试了iQDNS提供的DoQ服务(quic://8.210.68.247),问题完全相同

则可能是新版 quic-go 存在性能问题,请向他们提出问题

我的疑惑是:DoH3连接使用的应该同样是quic呀,为什么DoH3可以正常使用,DoQ就不行呢(至少在我这里观测如此)?

~(还是说我这个难道是个例)~

感谢您的解答!

我测试doh没问题,doq同样的错误。我是自建的doh和doq,没有测试doh3。我也是老版本的测试正常的配置文件在最新1.3不可用。前两个月我配置好了测试成功了配置文件就保存着没动过,然后最新的1.3我测试了下就不成功,我以为我配置文件有问题,重新配置了也是同样的上述的错误提示。

mzwing commented 1 year ago

我测试doh没问题,doq同样的错误。我是自建的doh和doq,没有测试doh3。我也是老版本的测试正常的配置文件在最新1.3不可用。前两个月我配置好了测试成功了配置文件就保存着没动过,然后最新的1.3我测试了下就不成功,我以为我配置文件有问题,重新配置了也是同样的上述的

请提供最小可重现客户端与服务器配置

这确实是最小可重现客户端配置,没有服务器配置(因为并没有用到sing-box服务器)

日志没有显示问题

但是我在box-latest-quic.log中的第81行(之后也还有很多类似的报错)中发现了ERROR,如下:


ERROR dns: exchange failed for www.msftconnecttest.com. IN AAAA: INTERNAL_ERROR (local): tls: either ServerName or InsecureSkipVerify must be specified in the tls.Config

而在使用DoH3时并无此问题。

而不是要求我们提供与商业闭源软件一起使用的支持

~(可是DoQ貌似也就那么几家有)~

已追加测试了iQDNS提供的DoQ服务(quic://8.210.68.247),问题完全相同

则可能是新版 quic-go 存在性能问题,请向他们提出问题

我的疑惑是:DoH3连接使用的应该同样是quic呀,为什么DoH3可以正常使用,DoQ就不行呢(至少在我这里观测如此)?

~(还是说我这个难道是个例)~

感谢您的解答!

我测试doh没问题,doq同样的错误。我是自建的doh和doq,没有测试doh3。我也是老版本的测试正常的配置文件在最新1.3不可用。前两个月我配置好了测试成功了配置文件就保存着没动过,然后最新的1.3我测试了下就不成功,我以为我配置文件有问题,重新配置了也是同样的上述的错误提示。

我后面追加测试了xray,xray的最新版本也有同样的问题。也许真的是新版quic-go有性能问题吧。