XHTTP transport: Add BBR and brutal-force congestion control for H3#5711
XHTTP transport: Add BBR and brutal-force congestion control for H3#5711
Conversation
|
这事在加hy传输的时候就该弄了 |
|
客户端 dialer 可以先不动,服务端可以先默认设个 bbr 先用着,反正目前也没有 cdn 可以 h3 回源 conn window 那些没必要过度追求 hy,保持默认值就好,congestion 可以在以后动客户端 dialer 的时候再加, |
|
目前用的人不多,两边都默认 bbr 就行, |
|
@Fangliding @LjhAUMEM 所以我觉得给客户端加 bbr 会更有用一些, |
hy 的传输层要求设置个 auth,
两边都默认也行, |
|
|
|
@RPRX xhttp h3也准备能吃bbr了? |
|
我感觉下行默认BBR就行了 别的不用改 就几行代码 |
You like to have no options to tune and the PR has hardcoded parameters to tune Xray-core/transport/internet/hysteria/dialer.go Lines 196 to 207 in efdf21e
I see no CUBIC CC here, quic-go default is Reno and the added CC is BBR |
暴露无意义的参数只会使配置选项越来越臃肿 你这么喜欢tune你知道bbr里也有一堆硬编码的经验主义参数吗? |
|
不过对于 QUIC 来说长远来看本来就应该可以自己配置 congestion 参数, 这个 PR 的话先把两端都改为默认 bbr 吧,其它的以后再说 |
|
Should I remove the custom QUIC receive window sizes (2/16/5/32 MB) and revert to quic-go defaults to avoid an externally observable fingerprint? 请问是否需要移除自定义的 QUIC 接收窗口大小(2/16/5/32 MB),恢复为 quic-go 默认值,以避免外部可观测的指纹特征? |
In the current PR, BBR is already set as the default for both sides. I can move the congestion setting to tlsSettings if needed. 在当前 PR 中,两端已默认使用 BBR。如果需要,我可以将 congestion 配置移到 tlsSettings 中。 |
|
|
|
只是对于 conn window 那些我有点犹豫,默认值应该就行, |
|
Should I make the window sizes configurable in the config rather than hardcoded? 是否需要将 window sizes 做成可配置的,而不是硬编码在代码中? |
Simply remove these hard-coded conn windows. If you want congestion configuration, add the force-brutal option as well (this may require an additional up/rate/bandwidth field); otherwise, removing the congestion configuration only retains the default bbr. |
|
Removed custom QUIC receive window sizes, using quic-go defaults now. I can add 已移除自定义 QUIC 接收窗口大小,改用 quic-go 默认值。 我可以加上 |
|
@RPRX 我想的是除了协商的 brutal 剩下的都可以接过来,但 force 可能要一个新的字段,和 hy 一样 up 还是 |
|
Ok, I've added the force-brutal algorithm with the "up" field for now. 好的,我暂时添加了 force-brutal 算法和 "up" 字段。 |
|
要不把所有这些东西都在 tlsSettings 里开一个 |
Haha, it's not exactly 哈哈,这不完全是 brutal。这是 force-brutal,我会在另一个 PR 中添加 brutal 的支持。 |
I'd really like to move this to 我确实想把这些移到 "xhttpSettings": {
"quic": {
"congestion": "force-brutal",
"up": "100 mbps"
}
} |
也可以,
no need to add brutal, xhttp3 is an unauth transport, but force-brutal can be added
Then move the settings to TLS, or keep only the default bbr part (including temporarily removing force-brutal, congestion configuration) and this PR can be merged. |
|
Moved settings to 将设置移至 |
|
looks good to me @RPRX |
刚刚才看到,最近没关注 issue, |
I noticed that VLESS TLS with XHTTP transport and ALPN H3 is significantly slower (~2x) compared to regular HTTP/2, and decided to investigate.
Turns out quic-go uses Reno congestion control by default, while TCP gets BBR from the Linux kernel - likely a contributing factor.
On top of that,(removed: keeping quic-go default window sizes) Hard to say which of these matters most, but together they should make a noticeable difference.quic.ListenEarlywas called withnilconfig, so all QUIC parameters were left at quic-go defaults. The default receive windows (512 KB) can also become a bottleneck on high-bandwidth or high-latency links.Both BBR and Brutal implementations reuse the existing
transport/internet/hysteria/congestionpackage (BBR is a port of Google's BBR v1 from Chromium, Brutal is from Hysteria2) to avoid code duplication and build on what's already in the codebase.Also added a
"congestion"setting totlsSettings:"bbr"(default) — BBR congestion control"reno"— quic-go default"force-brutal"— Brutal congestion control (requires"up"field)"force-brutal"reuses the existing brutal-force sender from the Hysteria transport (transport/internet/hysteria/congestion/brutal). It sends at a fixed rate regardless of packet loss. Requires the"up"field specifying the target upload bandwidth (same format as Hysteria2, e.g."100 mbps").{ "tlsSettings": { "alpn": ["h3"], "quic": { "congestion": "force-brutal", "up": "100 mbps" } } }