Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support bandwidth configuration #645

Merged
merged 8 commits into from
Sep 26, 2024
Merged

Conversation

mnixry
Copy link
Contributor

@mnixry mnixry commented Sep 19, 2024

Background

ref: daeuniverse/outbound#21

Checklist

Full Changelogs

  • Implement bandwidth config parsing in dae:

     global {
     	...
     
         # The maximum bandwidth for accessing the Internet. It is useful for some specific protocols (e.g., Hysteria2), 
         # which will perform better with bandwith information provided. The unit is **byte** per second.
         bandwidth_max_tx: 26214400 # 200Mbps == 25MB/s == 26214400 B/s uplink
         bandwidth_max_rx: 131072000 # 1Gbps == 125MB/s == 131072000 B/s downlink
     }
    
  • Improve handling for insecure parameter in hysteria2 URI parsing.

Issue Reference

Closes #[issue number]

Test Result

@mzz2017
Copy link
Contributor

mzz2017 commented Sep 19, 2024

提问,

  1. 当设置了带宽时,是否所有 hy2 节点都会使用 brutal?
  2. 有 hy2 节点不支持 brutal 的可能性吗

@mnixry
Copy link
Contributor Author

mnixry commented Sep 19, 2024

  1. 当设置了带宽时,是否所有 hy2 节点都会使用 brutal?

否,Hysteria2 协议会在握手时协商双方带宽。我们实现的行为是:如果服务端和客户端任意一方不提供带宽或者服务端选择忽略客户端带宽,那么它将会选择启用 BBR。只有当双方均设置了带宽的前提下才会取双方最小的带宽进行通信,具体流程在 上游 Hysteria 文档中有描述

  1. 有 hy2 节点不支持 brutal 的可能性吗

实际上确实有可能存在「服务端和客户端都提供了带宽参数,但是实际上不支持 Brutal」的情况,且根据协议这似乎是一个 Unspecified Behavior。但是由于我们的协商行为和官方客户端一致,所以当这种这种情况存在时,则该服务端将和一般通过官方客户端的互操作性也会难以保证,所以我们大概可以忽略这种情况。

@mzz2017
Copy link
Contributor

mzz2017 commented Sep 19, 2024

@mnixry 我不是一个 hy2 用户,但你解释的非常清楚,且对于我了解 PR 相关的风险非常重要,多谢解答

@mzz2017
Copy link
Contributor

mzz2017 commented Sep 19, 2024

@mnixry 麻烦在 pr 描述中也加入配置文件的示例,谢谢

@mnixry
Copy link
Contributor Author

mnixry commented Sep 19, 2024

麻烦在 pr 描述中也加入配置文件的示例,谢谢

done

example.dae Show resolved Hide resolved
@mzz2017
Copy link
Contributor

mzz2017 commented Sep 26, 2024

Since daeuniverse/outbound#21 is merged, consider to update go.mod and be ready to merge.
@mnixry

dae-prow[bot]
dae-prow bot previously approved these changes Sep 26, 2024
Copy link
Contributor

@dae-prow dae-prow bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧪 Since the PR has been fully tested, please consider merging it.

sumire88
sumire88 previously approved these changes Sep 26, 2024
@mnixry mnixry dismissed stale reviews from sumire88 and dae-prow[bot] via 105172c September 26, 2024 15:53
@mzz2017
Copy link
Contributor

mzz2017 commented Sep 26, 2024

@mnixry LGTM! Thanks for your contribution! Are you ready to merge?

@mzz2017 mzz2017 merged commit 7e751e0 into daeuniverse:main Sep 26, 2024
26 checks passed
douglarek added a commit to douglarek/dae that referenced this pull request Sep 28, 2024
douglarek added a commit to douglarek/dae that referenced this pull request Sep 29, 2024
@dae-prow dae-prow bot mentioned this pull request Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants